xen/usb-list.patch
Charles Arnold 05bedd5488 - bnc#681302 - xm create -x <guest> returns "ImportError: No module
named ext"
  xm-create-xflag.patch

- Fix xen-utils to cope with xen-unstable c/s 21483

- xz-devel is available since 11.2, make it optional for SLES11SP1

- bnc#665610 - xm console > 1 to same VM messes up both consoles
  Upstream rejected due to portability concern, see
  http://lists.xensource.com/archives/html/xen-devel/2011-02/msg00942.html
  xenconsole-no-multiple-connections.patch
- Enable support for kernel decompression for gzip, bzip2, and LZMA
  so that kernels compressed with any of these methods can be
  launched.

- Update to Xen 4.1.0 c/s 22861

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=102
2011-03-21 16:47:37 +00:00

46 lines
1.7 KiB
Diff

"usb-hc-create" does not check usb-ver parameter. It allows 2/2.0/2.0usb/2.0aaa. While low level
driver doing hc create, it gets an integer by vssanf %d from usb-ver string, so there is no problem.
But 2/2.0/2.0usb/2.0aaa will be saved into VM config.
After that, while doing "usb-list", it cannot handle "2.0/2.0usb/2.0aaa" and will cause error:
Idx BE state usb-ver BE-path
Error: Invalid argument.
Usage: xm usb-list <Domain>
This patch is to let "usb-list" handle all usb-ver cases as low level driver does and won't cause error.
About this problem, I've submitted two patches to upstream before, but got no response. Information
could be referred to:
http://www.gossamer-threads.com/lists/xen/devel/178406?search_string=usb-list;#178406
http://www.gossamer-threads.com/lists/xen/devel/181021?search_string=usb-list;#181021
Index: xen-4.1.0-testing/tools/python/xen/xm/main.py
===================================================================
--- xen-4.1.0-testing.orig/tools/python/xen/xm/main.py
+++ xen-4.1.0-testing/tools/python/xen/xm/main.py
@@ -2631,10 +2631,22 @@ def xm_usb_list(args):
ni = parse_dev_info(x[1])
ni['idx'] = int(x[0])
usbver = sxp.child_value(x[1], 'usb-ver')
+
+ substr = re.search("^\d{1,}", usbver)
+ if substr:
+ usbver = substr.group()
+ else:
+ print "Unknown usb-ver"
+ continue
+
if int(usbver) == 1:
ni['usb-ver'] = 'USB1.1'
- else:
+ elif int(usbver) == 2:
ni['usb-ver'] = 'USB2.0'
+ else:
+ print "Unknown usb-ver"
+ continue
+
print "%(idx)-3d %(backend-id)-3d %(state)-5d %(usb-ver)-7s %(be-path)-30s " % ni
ports = sxp.child(x[1], 'port')