From: Anthony Liguori <aliguori@us.ibm.com>
To: xen-devel@lists.sourceforge.net
Subject: [PATCH] Allow Xend to find device number for sdX or hdX with udev
Date: Fri, 14 Jan 2005 15:00:58 -0600 [thread overview]
Message-ID: <1105736457.7777.17.camel@localhost> (raw)
[-- Attachment #1: Type: text/plain, Size: 594 bytes --]
Symptom:
When using a udev-based dom0, if you try to create a domU with a virtual
sda device and you do not have a local scsi device xm create fails.
Fix:
When using udev, only the device nodes needed are made. The follow
patch changes Xend to return a device number based on:
http://www.lanana.org/docs/device-list/devices.txt
For sd and hd devices if stat() fails. It was tested against both 2.0.2
and 2.0.3.
Regards,
--
Anthony Liguori
Linux Technology Center (LTC) - IBM Austin
E-mail: aliguori@us.ibm.com
Phone: (512) 838-1208
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
[-- Attachment #2: xen_udev.diff --]
[-- Type: text/x-patch, Size: 830 bytes --]
Only in xen-2.0-new/tools/python/xen/lowlevel/xu: xu.c~
diff -ur xen-2.0/tools/python/xen/xend/server/blkif.py xen-2.0-new/tools/python/xen/xend/server/blkif.py
--- xen-2.0/tools/python/xen/xend/server/blkif.py 2005-01-03 21:46:13.000000000 -0600
+++ xen-2.0-new/tools/python/xen/xend/server/blkif.py 2005-01-12 18:40:17.648463000 -0600
@@ -63,6 +63,12 @@
log.debug("exception looking up device number for %s: %s", name, ex)
pass
+ if re.match( '/dev/sd[a-p]([0-9]|1[0-5])', n):
+ return 8 * 256 + 16 * (ord(n[7:8]) - ord('a')) + int(n[8:])
+
+ if re.match( '/dev/hd[a-p]([0-9]|[1-5][0-9]|6[0-3])', n):
+ return 3 * 256 + 16 * (ord(n[7:8]) - ord('a')) + int(n[8:])
+
# see if this is a hex device number
if re.match( '^(0x)?[0-9a-fA-F]+$', name ):
return string.atoi(name,16)
next reply other threads:[~2005-01-14 21:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-14 21:00 Anthony Liguori [this message]
2005-01-15 10:38 ` [PATCH] Allow Xend to find device number for sdX or hdX with udev Felipe Alfaro Solana
2005-01-15 10:56 ` Jan Kundrát
2005-01-17 12:17 ` Nuutti Kotivuori
2005-01-17 13:11 ` Ian Pratt
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=1105736457.7777.17.camel@localhost \
--to=aliguori@us.ibm.com \
--cc=xen-devel@lists.sourceforge.net \
/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.