Chun Yan Liu
2010-Jul-12 07:07 UTC
[Xen-devel][PATCH]Fix bug that usb-list broken after usb-hc-create
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@lists.xensource.com http://lists.xensource.com/xen-devel