Stephen C. Tweedie
2006-Sep-28 17:36 UTC
[Xen-devel] [Patch] 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> 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@lists.xensource.com http://lists.xensource.com/xen-devel
Andrew Warfield
2006-Sep-28 19:13 UTC
[Xen-devel] Re: [Patch] Fix blktap to work with a bootloader
Applied, thanks! a. On 9/28/06, Stephen C. Tweedie <sct@redhat.com> 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@redhat.com> > > 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@lists.xensource.com http://lists.xensource.com/xen-devel
Stephen C. Tweedie
2006-Oct-10 14:56 UTC
[Xen-devel] Re: [Patch] Fix blktap to work with a bootloader
Hi all, On Thu, 2006-09-28 at 18:36 +0100, Stephen C. Tweedie wrote:> The fix is to split only at the first ":", and then to split again > if we detect "tap:" as the image type.Whoops, xen is still broken ---> Signed-off-by: Stephen Tweedie <sct@redhat.com> > --- 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): > 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 fnwas what I posted, but only the second two new lines actually got committed to the xenbits repository. Without the first split(":", 1) change, we''ll split at _all_ the ":"s in the uname, and if there are more than one, then the assignment to the (typ,fn) 2-tuple will fail. Can this please be fixed properly? It''s just a 3-character commit that''s left. :-) btw, is the process of merging patches from email being done completely manually? git certainly has really good pull-from-email scripts that avoid this sort of oversight, but I''m not sure hg is quite so well equipped. Cheers, Stephen _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Oct-10 15:01 UTC
Re: [Xen-devel] Re: [Patch] Fix blktap to work with a bootloader
On 10/10/06 15:56, "Stephen C. Tweedie" <sct@redhat.com> wrote:> btw, is the process of merging patches from email being done completely > manually? git certainly has really good pull-from-email scripts that > avoid this sort of oversight, but I''m not sure hg is quite so well > equipped.Usually patches are applied as a whole unit using ''patch'', even if they have to be manually extracted from the email. Looks like Andy might have done this one by hand and got it wrong! -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ewan Mellor
2006-Oct-10 15:26 UTC
Re: [Xen-devel] Re: [Patch] Fix blktap to work with a bootloader
On Tue, Oct 10, 2006 at 04:01:42PM +0100, Keir Fraser wrote:> On 10/10/06 15:56, "Stephen C. Tweedie" <sct@redhat.com> wrote: > > > btw, is the process of merging patches from email being done completely > > manually? git certainly has really good pull-from-email scripts that > > avoid this sort of oversight, but I''m not sure hg is quite so well > > equipped. > > Usually patches are applied as a whole unit using ''patch'', even if they have > to be manually extracted from the email. Looks like Andy might have done > this one by hand and got it wrong!On that note, _please_ can people submit patches 1. as attachments, 2. with a text/plain MIME type, and preferably 3. using hg export with a decent comment and a Signed-off-by: line in place. It makes life a lot easier! If your mailer doesn''t do text/plain attachments properly, and for some reason you still want to use such a broken heap of four-ex, then the next best thing is plain-text inline in the message (because most people can''t review patches very easily if your mailer has sent it as an octet-stream). Thanks, Ewan. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Aron Griffis
2006-Oct-17 19:45 UTC
Re: [Xen-devel] Re: [Patch] Fix blktap to work with a bootloader
Ewan Mellor wrote: [Tue Oct 10 2006, 11:26:53AM EDT]> On that note, _please_ can people submit patches > > 1. as attachments, > 2. with a text/plain MIME type, and preferably > 3. using hg export with a decent comment and a Signed-off-by: line in place. > > It makes life a lot easier!if this is what you''d like, it might be helpful if you''d provide a patch to mercurial''s patchbomb extension (i.e. hg email) to work in this manner. Presently it does inline only. Aron _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Oct-17 19:55 UTC
Re: [Xen-devel] Re: [Patch] Fix blktap to work with a bootloader
On 17/10/06 8:45 pm, "Aron Griffis" <aron@hp.com> wrote:>> On that note, _please_ can people submit patches >> >> 1. as attachments, >> 2. with a text/plain MIME type, and preferably >> 3. using hg export with a decent comment and a Signed-off-by: line in >> place. >> >> It makes life a lot easier! > > if this is what you''d like, it might be helpful if you''d provide > a patch to mercurial''s patchbomb extension (i.e. hg email) to work in > this manner. Presently it does inline only.Inline is fine so long as your email client doesn''t mangle the patch. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel