From: Mark McLoughlin <markmc@redhat.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] [RESEND] Don't mount raw blktap disks for pygrub
Date: Wed, 07 Mar 2007 16:29:15 +0000 [thread overview]
Message-ID: <1173284955.19604.2.camel@blaa> (raw)
[-- Attachment #1: Type: text/plain, Size: 489 bytes --]
(Doesn't seem to be in the staging tree; re-sending just in case it
slipped through the cracks)
Hi,
Currently, we mount all blktap disks for pygrub so that it can boot
from e.g. QCOW images. However, since pygrub will handle a raw image
just fine without mounting through blktap, we shouldn't bother in that
case.
Also, it looks like XendDomainInfo.create_vbd() takes the full disk
uname rather than the image path.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Cheers,
Mark.
[-- Attachment #2: xen-boot-tap-aio-disk.patch --]
[-- Type: text/x-patch, Size: 2534 bytes --]
diff -r 3ac19fda0bc2 tools/python/xen/util/blkif.py
--- a/tools/python/xen/util/blkif.py Fri Mar 02 12:11:52 2007 +0000
+++ b/tools/python/xen/util/blkif.py Mon Mar 05 10:06:00 2007 +0000
@@ -66,16 +66,23 @@ def blkdev_segment(name):
'type' : 'Disk' }
return val
-def blkdev_uname_to_file(uname):
- """Take a blkdev uname and return the corresponding filename."""
- fn = None
+def _parse_uname(uname):
+ fn = taptype = None
if uname.find(":") != -1:
(typ, fn) = uname.split(":", 1)
if typ == "phy" and not fn.startswith("/"):
fn = "/dev/%s" %(fn,)
if typ == "tap":
- (typ, fn) = fn.split(":", 1)
- return fn
+ (taptype, fn) = fn.split(":", 1)
+ return (fn, taptype)
+
+def blkdev_uname_to_file(uname):
+ """Take a blkdev uname and return the corresponding filename."""
+ return _parse_uname(uname)[0]
+
+def blkdev_uname_to_taptype(uname):
+ """Take a blkdev uname and return the blktap type."""
+ return _parse_uname(uname)[1]
def mount_mode(name):
mode = None
diff -r 3ac19fda0bc2 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py Fri Mar 02 12:11:52 2007 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py Mon Mar 05 10:30:06 2007 +0000
@@ -34,7 +34,7 @@ from types import StringTypes
import xen.lowlevel.xc
from xen.util import asserts
-from xen.util.blkif import blkdev_uname_to_file
+from xen.util.blkif import blkdev_uname_to_file, blkdev_uname_to_taptype
from xen.util import security
from xen.xend import balloon, sxp, uuid, image, arch, osdep
@@ -1768,7 +1768,8 @@ class XendDomainInfo:
disk = devinfo[1]['uname']
fn = blkdev_uname_to_file(disk)
- mounted = devtype == 'tap' and not os.stat(fn).st_rdev
+ taptype = blkdev_uname_to_taptype(disk)
+ mounted = devtype == 'tap' and taptype != 'aio' and taptype != 'sync' and not os.stat(fn).st_rdev
if mounted:
# This is a file, not a device. pygrub can cope with a
# file if it's raw, but if it's QCOW or other such formats
@@ -1784,7 +1785,7 @@ class XendDomainInfo:
from xen.xend import XendDomain
dom0 = XendDomain.instance().privilegedDomain()
- dom0._waitForDeviceUUID(dom0.create_vbd(vbd, fn))
+ dom0._waitForDeviceUUID(dom0.create_vbd(vbd, disk))
fn = BOOTLOADER_LOOPBACK_DEVICE
try:
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2007-03-07 16:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-07 16:29 Mark McLoughlin [this message]
2007-03-07 16:35 ` [PATCH] [RESEND] Don't mount raw blktap disks for pygrub Andrew Warfield
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=1173284955.19604.2.camel@blaa \
--to=markmc@redhat.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.