All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Knorr <kraxel@suse.de>
To: Chris Bainbridge <chris.bainbridge@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@novell.com>,
	xen-devel <xen-devel@lists.xensource.com>,
	Kurt Garloff <garloff@suse.de>
Subject: network & block device setup via udev
Date: Thu, 06 Oct 2005 17:54:10 +0200	[thread overview]
Message-ID: <434548A2.2040605@suse.de> (raw)
In-Reply-To: <623652d5050926085463c049ed@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 800 bytes --]

Chris Bainbridge wrote:
> On 26/09/05, Gerd Knorr <kraxel@suse.de> 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

[-- Attachment #2: 40-xen.rules --]
[-- Type: text/plain, Size: 448 bytes --]

# 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"


[-- Attachment #3: xen-vbd --]
[-- Type: text/plain, Size: 558 bytes --]

#!/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


[-- Attachment #4: xen-vif --]
[-- Type: text/plain, Size: 357 bytes --]

#!/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


[-- Attachment #5: Type: text/plain, Size: 138 bytes --]

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

      reply	other threads:[~2005-10-06 15:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-23 14:15 Cannot create domU NAHieu
2005-09-23 17:37 ` Michael Vrable
2005-09-23 17:43   ` Michael Vrable
2005-09-23 18:00     ` Michael Vrable
2005-09-23 22:39   ` Chris Bainbridge
2005-09-24  7:38     ` Keir Fraser
2005-09-24 10:54       ` Chris Bainbridge
2005-09-24 13:21         ` Keir Fraser
2005-09-24 17:32           ` NAHieu
2005-09-24 20:00           ` Chris Bainbridge
2005-09-25 10:19             ` Keir Fraser
     [not found]             ` <20050926124707.GA13414@kroah.com>
2005-09-26 13:23               ` Keir Fraser
     [not found]                 ` <20050926141407.GA15384@kroah.com>
2005-09-26 14:41                   ` Keir Fraser
2005-09-26 15:01                     ` Greg KH
2005-09-26 15:41                       ` Keir Fraser
2005-09-26 21:22                         ` Greg KH
2005-09-27 15:33                           ` Chris Bainbridge
2005-09-30 14:48                             ` Chris Bainbridge
2005-09-26 14:59                 ` Gerd Knorr
2005-09-26 15:54                   ` Chris Bainbridge
2005-10-06 15:54                     ` Gerd Knorr [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=434548A2.2040605@suse.de \
    --to=kraxel@suse.de \
    --cc=chris.bainbridge@gmail.com \
    --cc=garloff@suse.de \
    --cc=gregkh@novell.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.