WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel][PATCH]Fix bug that usb-list broken after usb-hc-create
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
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

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
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel][PATCH]Fix bug that usb-list broken after usb-hc-create, Chun Yan Liu <=