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

Re: [Xen-devel] [PATCH 5/6] libxl: add HVM usb passthrough support



On 09/09/16 11:00, Wei Liu wrote:
> On Thu, Sep 08, 2016 at 09:20:25AM +0200, Juergen Gross wrote:
>> Add HVM usb passthrough support to libxl by using qemu's capability
>> to emulate standard USB controllers.
>>
>> A USB controller is added via qmp command to the emulated hardware
>> when a usbctrl device of type DEVICEMODEL is requested. Depending on
>> the requested speed the appropriate hardware type is selected. A host
>> USB device can then be added to the emulated USB controller via qmp
>> command.
>>
>> Removing of the devices is done via qmp commands, too.
>>
>> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
> [...]
>>  
>> @@ -75,9 +131,19 @@ static int libxl__device_from_usbctrl(libxl__gc *gc, 
>> uint32_t domid,
>>  {
>>      device->backend_devid   = usbctrl->devid;
>>      device->backend_domid   = usbctrl->backend_domid;
>> -    device->backend_kind    = (usbctrl->type == LIBXL_USBCTRL_TYPE_PV)
>> -                              ? LIBXL__DEVICE_KIND_VUSB
>> -                              : LIBXL__DEVICE_KIND_QUSB;
>> +    switch (usbctrl->type) {
>> +    case LIBXL_USBCTRL_TYPE_PV:
>> +        device->backend_kind = LIBXL__DEVICE_KIND_VUSB;
>> +        break;
>> +    case LIBXL_USBCTRL_TYPE_QUSB:
>> +        device->backend_kind = LIBXL__DEVICE_KIND_QUSB;
>> +        break;
>> +    case LIBXL_USBCTRL_TYPE_DEVICEMODEL:
>> +        device->backend_kind = LIBXL__DEVICE_KIND_NONE;
> 
> I'm not quite sure if I follow this. Shouldn't we need a new kind of
> backend for this?

If you look at the previous patch, Jueren used "backend_kind == NONE"
specifically to mean libxl shouldn't do any messing around with setting
up or tearing down backends.  If we don't use "NONE", then we have to
special-case all the controller types that don't need backends.
Juergen's way seems reasonable (having only taken a quick look at it).

 -George


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

 


Rackspace

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