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

Re: [Xen-devel] [PATCH V4 3/7] libxl: add pvusb API



On 06/10/2015 05:20 AM, Chunyan Liu wrote:
Add pvusb APIs, including:
  - attach/detach (create/destroy) virtual usb controller.
  - attach/detach usb device
  - list usb controller and usb devices
  - some other helper functions

Signed-off-by: Chunyan Liu <cyliu@xxxxxxxx>
Signed-off-by: Simon Cao <caobosimon@xxxxxxxxx>

I've tested the patches with an old SUSE pvusb backend and my new one.

While all cases I tried worked with xm, the xl variant had some problems
with both backends, the new one being worse. I suspect especially this
patch to be faulty, as it has IMHO a potential structural problem: when
trying to attach a USB device without having created a usb-controller
for the domain, an asynchronous libxl-operation will itself call
another async operation.
The second async operation is being called with ao_how being NULL, but
I'm not sure whether this is allowed (libxl_internal.h comments are not
clear for me regarding such a scenario).

libxl_device_usb_add()
  AO_CREATE(ctx, domid, ao_how)
  libxl__device_usb_add()
    libxl__device_usb_setdefault()
      libxl_device_usbctrl_add_common()
        AO_CREATE(ctx, domid, NULL)

Tests with the new backend:

What I'm seeing is an error message that the controller couldn't be
assigned and the device would fail, too.

The real result, however, is an assigned controller, but no device.
Manual assignment of the device succeeds afterwards.

doing "xl usb-ctrl-attach" and then "xl usb-attach" is working, too.

Assigning a device via config file fails always (binding of device to
backend failed).


Tests with the old backend:

All tests but assigning a device via config file worked (again the
same binding error).


As I'm currently trying to write a new pvusb backend in qemu, I don't
want to investigate the xl problems with the new kernel backend. I
suspect some timing differences between old and new kernel drivers
leading to the different results.

As the qemu variant wouldn't need any driver rebinding in libxl (qemu
is handling this by itself) I wouldn't be worried too much about the
config file problem.

If, however, the nested usage of AO_CREATE is forbidden, this has to
be changed, of course.


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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