[libvirt] [PATCH v3 2/2] Add USB option capability

Li Zhang zhlcindy at gmail.com
Wed Apr 3 02:14:15 UTC 2013


On 2013年04月02日 18:06, Daniel P. Berrange wrote:
> On Fri, Mar 29, 2013 at 01:22:47PM +0800, Li Zhang wrote:
>> From: Li Zhang <zhlcindy at linux.vnet.ibm.com>
>>
>> To avoid the collision for creating USB controllers in machine->init()
>> and -device xx command line, it needs to set usb=off to avoid one USB
>> controller created in machine->init(). So that libvirt can use -device
>> or -usb to create USB controller sucessfully.
>> So QEMU_CAPS_MACHINE_USB_OPT capability is added, and it is for QEMU
>> v1.3.0 onwards which supports USB option.
>>
>> Signed-off-by: Li Zhang <zhlcindy at linux.vnet.ibm.com>
>
> I'm not seeing why this is needed - we pass -nodefconfig and -nodefaults
> which ought to disable any default built-in USB controller already
> surely ?

With -nodefconfig and -nodefaults, QEMU doesn't disable USB controller.

In QEMU, USB controller will be created according to usb_enabled(default).
This the default value can be set according to different platforms.
For example, in pSeries guest,
Because there are no ps2 devices, so it needs USB keyboard and mouse 
with VGA.
So, USB controller will be created with graphic enabled in machine->init().

if (usb_enabled(spapr->has_graphics)) {
     pci_create_simple(phb->bus, -1, "pci-ohci");
     if (spapr->has_graphics) {
        usbdevice_create("keyboard");
        usbdevice_create("mouse");
     }
}

Libvirt can't know this controller which is created by QEMU.
So it will report error. :)

>
> Daniel




More information about the libvir-list mailing list