File tree Expand file tree Collapse file tree 3 files changed +79
-0
lines changed Expand file tree Collapse file tree 3 files changed +79
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ TYPE=` echo ${XENBUS_PATH} | cut -f 2 -d ' /' `
4+ DOMID=` echo ${XENBUS_PATH} | cut -f 3 -d ' /' `
5+ DEVID=` echo ${XENBUS_PATH} | cut -f 4 -d ' /' `
6+
7+ HOTPLUG=/xapi/${DOMID} /hotplug/${TYPE} /${DEVID}
8+ HOTPLUG_STATUS=" ${XENBUS_PATH} /hotplug-status"
9+
10+ syslog ()
11+ {
12+ logger -tscripts-block " $* "
13+ }
14+
15+ case " $1 " in
16+ add)
17+ params=$( xenstore-read " ${XENBUS_PATH} /params" )
18+ frontend=" /local/domain/${DOMID} /device/${TYPE} /${DEVID} "
19+ syslog " ${XENBUS_PATH} : add params=\" ${params} \" "
20+ # We don't have PV drivers for CDROM devices, so we prevent blkback
21+ # from opening the physical-device
22+ xenstore-exists " ${XENBUS_PATH} /no-physical-device"
23+ if [ $? -ne 0 ]; then
24+ physical_device=$( /usr/bin/stat --format=" %t:%T" " ${params} " )
25+ syslog " ${XENBUS_PATH} : physical-device=${physical_device} "
26+ xenstore-exists " ${XENBUS_PATH} /physical-device"
27+ if [ $? -eq 1 ]; then
28+ syslog " ${XENBUS_PATH} : writing physical-device=${physical-device} "
29+ xenstore-write " ${XENBUS_PATH} /physical-device" " ${physical_device} "
30+ fi
31+ else
32+ syslog " ${XENBUS_PATH} : not writing physical-device because no-physical-device is present"
33+ fi
34+ xenstore-write " ${HOTPLUG} /hotplug" " online"
35+ xenstore-write " ${HOTPLUG_STATUS} " " connected"
36+ ;;
37+ change)
38+ syslog " ${XENBUS_PATH} : change"
39+ ;;
40+ remove)
41+ syslog " ${XENBUS_PATH} : remove"
42+ xenstore-rm " ${HOTPLUG_STATUS} "
43+ xenstore-rm " ${HOTPLUG} /hotplug"
44+ ;;
45+ esac
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ TYPE=` echo ${XENBUS_PATH} | cut -f 2 -d ' /' `
4+ DOMID=` echo ${XENBUS_PATH} | cut -f 3 -d ' /' `
5+ DEVID=` echo ${XENBUS_PATH} | cut -f 4 -d ' /' `
6+
7+ XAPI=/xapi/${DOMID} /hotplug/${TYPE} /${DEVID}
8+
9+ syslog ()
10+ {
11+ BLKTAP=daemon
12+ logger -p$BLKTAP .info -tscripts-tap " $* "
13+ }
14+
15+ case " $1 " in
16+ add)
17+ syslog " $XAPI : hotplug deferred to backend change"
18+ ;;
19+ change)
20+ syslog " $XAPI : backend changed"
21+ xenstore-write " ${XAPI} /hotplug" " online"
22+ ;;
23+ remove)
24+ syslog " $XAPI : backend removed"
25+ xenstore-rm " ${XAPI} /hotplug"
26+ ;;
27+ esac
Original file line number Diff line number Diff line change 1+ SUBSYSTEM=="xen-backend", KERNEL=="tap*", RUN+="/usr/libexec/xenopsd/tap $env{ACTION}"
2+ SUBSYSTEM=="xen-backend", KERNEL=="vbd*", RUN+="/usr/libexec/xenopsd/block $env{ACTION}"
3+
4+ SUBSYSTEM=="xen-backend", KERNEL=="vif*", RUN+="/usr/libexec/xenopsd/vif $env{ACTION} type_if=vif"
5+ SUBSYSTEM=="net", KERNEL=="tap*", RUN+="/usr/libexec/xenopsd/vif $env{ACTION} type_if=tap"
6+
7+ KERNEL=="evtchn", NAME="xen/%k"
You can’t perform that action at this time.
0 commit comments