From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Knorr Subject: network & block device setup via udev Date: Thu, 06 Oct 2005 17:54:10 +0200 Message-ID: <434548A2.2040605@suse.de> References: <5d7aca9505092307156e0c7f00@mail.gmail.com> <20050923173759.GA25613@vrable.net> <623652d5050923153973b9804c@mail.gmail.com> <7d249e777fd88c08faab74751b15fca6@cl.cam.ac.uk> <623652d50509240354750991d3@mail.gmail.com> <9f173d1d7dea2ed7b9d458acd070f552@cl.cam.ac.uk> <623652d505092413006f3950b@mail.gmail.com> <20050926124707.GA13414@kroah.com> <43380CE4.6010909@suse.de> <623652d5050926085463c049ed@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060205000501020202070305" Return-path: In-Reply-To: <623652d5050926085463c049ed@mail.gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Chris Bainbridge Cc: Greg Kroah-Hartman , xen-devel , Kurt Garloff List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------060205000501020202070305 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Chris Bainbridge wrote: > On 26/09/05, Gerd Knorr 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 --------------060205000501020202070305 Content-Type: text/plain; name="40-xen.rules" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="40-xen.rules" # 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" --------------060205000501020202070305 Content-Type: text/plain; name="xen-vbd" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xen-vbd" #!/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 --------------060205000501020202070305 Content-Type: text/plain; name="xen-vif" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xen-vif" #!/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 --------------060205000501020202070305 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------060205000501020202070305--