[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] network & block device setup via udev



Chris Bainbridge wrote:
On 26/09/05, Gerd Knorr <kraxel@xxxxxxx> wrote:
I've attached my current configuration.  ifup-xen goes to /sbin, the
rules file into /etc/udev/rules.d.  With those two files in place
auto-adding interfaces to the bridge WorksForMe[tm].

Can you post your udev rules/scripts for virtual block devices? Thanks.

Uhm, well, the above was with a older xen-unstable which hasn't the hotplug-ified setup for disks yet.

Attached below is my current setup, running flawlessly with a fresh checkout. The rules file goes to /etc/udev/rules.d, the xen-* shell scripts to /sbin. No dependency on hotplug any more, everything is invoked directly via udev (or udevd), so this should create much less trouble than the xen-hotplug.agent stuff.

cheers & enjoy

  Gerd
# xen-backend block devices
SUBSYSTEM=="xen-backend", ENV{XENBUS_TYPE}=="vbd", ACTION=="add",    
RUN+="/sbin/xen-vbd %k up"
SUBSYSTEM=="xen-backend", ENV{XENBUS_TYPE}=="vbd", ACTION=="remove", 
RUN+="/sbin/xen-vbd %k down"

# xen-backend network devices
SUBSYSTEM=="xen-backend", ENV{XENBUS_TYPE}=="vif", ACTION=="online", 
RUN+="/sbin/xen-vif %k up"
SUBSYSTEM=="xen-backend", ENV{XENBUS_TYPE}=="vif", ACTION=="remove", 
RUN+="/sbin/xen-vif %k down"

#!/bin/sh
# bring up and down xen-backend block devices
# called via /etc/udev/rules.4/40-xen.rules

dev="$1"
mode="$2"

export PATH="/sbin:/bin:/usr/sbin:/usr/bin"
logger -p local0.info "$(basename $0): $dev $mode [${XENBUS_PATH}]"

type=$(xenstore-read "${XENBUS_PATH}/type")
script=/etc/xen/scripts/block-${type}
test -x "$script" || exit

case "$mode" in
        up)
                params=$(xenstore-read "${XENBUS_PATH}/params")
                $script bind $params
                ;;
        down)
                node=$(xenstore-read "${XENBUS_PATH}/node")
                $script unbind $node
                xenstore-rm "$XENBUS_PATH"
                ;;
esac

#!/bin/sh
# bring up and down xen-backend network devices
# called via /etc/udev/rules.4/40-xen.rules

dev="$1"
mode="$2"

export PATH="/sbin:/bin:/usr/sbin:/usr/bin"
logger -p local0.info "$(basename $0): $dev $mode [${XENBUS_PATH}]"

case "$mode" in
        up)
                if test -x "$script"; then
                        $script up
                fi
                ;;
        down)
                xenstore-rm "$XENBUS_PATH"
                ;;
esac

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.