WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Chris Bainbridge <chris.bainbridge@xxxxxxxxx>
Subject: [Xen-devel] network & block device setup via udev
From: Gerd Knorr <kraxel@xxxxxxx>
Date: Thu, 06 Oct 2005 17:54:10 +0200
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Kurt Garloff <garloff@xxxxxxx>
Delivery-date: Thu, 06 Oct 2005 15:51:42 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <623652d5050926085463c049ed@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <5d7aca9505092307156e0c7f00@xxxxxxxxxxxxxx> <20050923173759.GA25613@xxxxxxxxxx> <623652d5050923153973b9804c@xxxxxxxxxxxxxx> <7d249e777fd88c08faab74751b15fca6@xxxxxxxxxxxx> <623652d50509240354750991d3@xxxxxxxxxxxxxx> <9f173d1d7dea2ed7b9d458acd070f552@xxxxxxxxxxxx> <623652d505092413006f3950b@xxxxxxxxxxxxxx> <20050926124707.GA13414@xxxxxxxxx> <fe13108c1a010f99eb1dd063df18e4d9@xxxxxxxxxxxx> <43380CE4.6010909@xxxxxxx> <623652d5050926085463c049ed@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050715)
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
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] network & block device setup via udev, Gerd Knorr <=