Xen 
 
Home About Xen.org Xen Xen Summit Wiki Mailing List Bug Tracker Xen Downloads
 
   
 

xen-devel

[Xen-devel] Re: [Patch] Fix blktap to work with a bootloader

To: "Stephen C. Tweedie" <sct@xxxxxxxxxx>
Subject: [Xen-devel] Re: [Patch] Fix blktap to work with a bootloader
From: "Andrew Warfield" <andrew.warfield@xxxxxxxxxxxx>
Date: Thu, 28 Sep 2006 12:13:47 -0700
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Julian Chesterfield <jac90@xxxxxxxxx>
Delivery-date: Thu, 28 Sep 2006 12:15:17 -0700
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=OBidVAzNdj7ZT5sVdIS3cwDzWrW0GIcxRBq7Rj4T1YuCk6pLZeN7PBoB7e9qUg9ki1qVQFQCUIMysX4mooAEJfP3YuAhQ+VLmleEw8ikJdbU0ggXMlUZ+2gLAMx/azlM2ivSZnSarADG6M4Jcq86J/o9jwEzUl+dV0TTd9+DUY4=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1159465004.8884.23.camel@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1159465004.8884.23.camel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Applied, thanks!

a.

On 9/28/06, Stephen C. Tweedie <sct@xxxxxxxxxx> wrote:
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@xxxxxxxxxx>

diff -r 94df5bd84195 -r aeba3dd98fbb tools/python/xen/util/blkif.py
--- a/tools/python/xen/util/blkif.py    Thu Sep 28 17:09:09 2006 +0100
+++ b/tools/python/xen/util/blkif.py    Thu Sep 28 18:05:08 2006 +0100
@@ -64,9 +64,11 @@ def blkdev_uname_to_file(uname):
     """Take a blkdev uname and return the corresponding filename."""
     fn = None
     if uname.find(":") != -1:
-        (typ, fn) = uname.split(":")
+        (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

 def mount_mode(name):




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

<Prev in Thread] Current Thread [Next in Thread>