[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel][PATCH]Fix bug that usb-list broken after usb-hc-create


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "Chun Yan Liu" <cyliu@xxxxxxxxxx>
  • Date: Mon, 12 Jul 2010 01:07:03 -0600
  • Delivery-date: Mon, 12 Jul 2010 00:07:57 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

usb-hc-create can accept <USBSpecVer> parameter in 2 or 2.0 format for USB2.0. In its implementation, the integer part is used, so 2 and 2.0 are both OK. But after usb-hc-create, usb-list source code has some problem to handle 2.0 format and will return error.


This patch is to let usb-list handle 2.0 format for <USBSpecVer> correctly, which is consistent with usb-hc-create. And add parameter description for <USBSpecVer> to "usb-hc-create" so to guide users how to fill this parameter, otherwise users might be confused about the parameter format.


diff -r 71bb47f16ec8 tools/python/xen/xm/main.py

--- a/tools/python/xen/xm/main.pyFri Jun 18 15:53:05 2010 +0800

+++ b/tools/python/xen/xm/main.pyFri Jun 25 14:59:14 2010 +0800

@@ -228,7 +228,7 @@

     'usb-list'    :  ('<Domain>',

                         'List domain\'s attachment state of all virtual port .'),

     'usb-list-assignable-devices' : ('', 'List all the assignable usb devices'),

-    'usb-hc-create'  :  ('<Domain> <USBSpecVer> <NumberOfPorts>',

+    'usb-hc-create'  :  ('<Domain> <USBSpecVer> <NumberOfPorts>\n       ## <USBSpecVer>: 2/2.0 (for USB2.0), 1/1.1 (for USB1.1)',

                         'Create a domain\'s new virtual USB host controller.'),

     'usb-hc-destroy'  :  ('<Domain> <DevId>',

                         'Destroy a domain\'s virtual USB host controller.'),

@@ -2585,7 +2585,7 @@

         ni = parse_dev_info(x[1])

         ni['idx'] = int(x[0])

         usbver = sxp.child_value(x[1], 'usb-ver')

-        if int(usbver) == 1:

+        if int(float(usbver)) == 1:

             ni['usb-ver'] = 'USB1.1'

         else:

             ni['usb-ver'] = 'USB2.0'


 


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.