[BLKTAP][XEND] Fix blktap to work with a bootloader

If a Xen guest has a bootloader configured, then it will fail to start
on a blktap image.  The problem is blkdev_uname_to_file, which cannot
parse the "tap:aio:$filename" image strings: it tries to split the
string apart at ":" and assign the result to a 2-tuple, and this
results in a python error if the split results in three or more
strings.

The fix is to split only at the first ":", and then to split again
if we detect "tap:" as the image type.

Signed-off-by: Stephen Tweedie <sct@redhat.com>
This commit is contained in:
Andrew Warfield committed 2006-09-28 12:12:59 -07:00
1 parent 577a31b661
commit 8e7cc683c5
1 file changed
+2
+2
View File
@@ -67,6 +67,8 @@ def blkdev_uname_to_file(uname):
(typ, fn) = uname.split(":")
if typ == "phy" and not fn.startswith("/"):
fn = "/dev/%s" %(fn,)
if typ == "tap":
(typ, fn) = fn.split(":", 1)
return fn
def mount_mode(name):
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.