Chris Lalancette
2008-Jun-23 18:27 UTC
[Xen-devel] [PATCH 4/4]: python blkdev_name_to_number fixes
This patch reworks blkdev_name_to_number to allow the tools to attach xvd disks beyond xvdp. Once this patch is applied, the whole system should work together and allow disks xvdq onwards. The patch does 2 things: 1. Adds the handling for the /dev/xvd[q-z] and /dev/xvd[a-i][a-z] extended devices 2. Changes blkdev_name_to_number() to return a tuple of (xenbus, devnum), and then deals with the resulting fallout. I freely admit that the change to tools/python/xen/xm/main.py is horrible, but my python is not very good. If someone can suggest a better way to do it, I would appreciate it. Signed-off-by: Chris Lalancette <clalance@redhat.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Brendan Cully
2008-Jun-23 18:40 UTC
Re: [Xen-devel] [PATCH 4/4]: python blkdev_name_to_number fixes
On Monday, 23 June 2008 at 20:27, Chris Lalancette wrote:> This patch reworks blkdev_name_to_number to allow the tools to attach xvd disks > beyond xvdp. Once this patch is applied, the whole system should work together > and allow disks xvdq onwards. The patch does 2 things: > > 1. Adds the handling for the /dev/xvd[q-z] and /dev/xvd[a-i][a-z] extended devices > > 2. Changes blkdev_name_to_number() to return a tuple of (xenbus, devnum), and > then deals with the resulting fallout. > > I freely admit that the change to tools/python/xen/xm/main.py is horrible, but > my python is not very good. If someone can suggest a better way to do it, I > would appreciate it....> diff -r dedfadeadf86 tools/python/xen/xm/main.py > --- a/tools/python/xen/xm/main.py Fri Jun 20 18:42:45 2008 +0100 > +++ b/tools/python/xen/xm/main.py Mon Jun 23 17:47:49 2008 +0200 > @@ -2022,8 +2022,11 @@ def xm_block_list(args): > map(server.xenapi.VBD.get_runtime_properties, vbd_refs) > vbd_devs = \ > map(server.xenapi.VBD.get_device, vbd_refs) > - vbd_devids = \ > + tmp_devids = \ > map(blkdev_name_to_number, vbd_devs) > + vbd_devids = [] > + for dev in tmp_devids: > + vbd_devids.append(dev[1]) > devs = map(lambda (devid, prop): [devid, map2sxp(prop)], > zip(vbd_devids, vbd_properties)) > else:vbd_devids = [blkdev_name_to_number(x)[1] for x in vbd_devs] is probably more idiomatic. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Chris Lalancette
2008-Jun-24 07:39 UTC
Re: [Xen-devel] [PATCH 4/4]: python blkdev_name_to_number fixes
Brendan Cully wrote:> > vbd_devids = [blkdev_name_to_number(x)[1] for x in vbd_devs] > > is probably more idiomatic.Ah yes, much better. Thanks a lot! Chris Lalancette _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel