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

Daniel P. Berrange berrange at redhat.com
Wed Apr 3 16:20:36 UTC 2013


On Wed, Apr 03, 2013 at 10:14:15AM +0800, Li Zhang wrote:
> 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. :)

Ok, I see what's going on now. This is horrible QEMU behaviour, but we
have to live with it.

So I'm ok with your proposed patch. Before we can commit it though, either
you need to update some existing test case, or add a new test case that
covers this CLI option.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list