[virt-tools-list] [PATCH 1/2] virtinst: add default USB controller if it's missing

Marc-André Lureau mlureau at redhat.com
Thu Oct 6 18:05:18 UTC 2011


Hi

----- Original Message -----
> > +
> > +        def has_usb_ctrl():
> > +            for ctrl in
> > self.get_devices(VirtualDevice.VIRTUAL_DEV_CONTROLLER):
> > +                if ctrl.type == ctrl.CONTROLLER_TYPE_USB:
> > +                    return True
> > +            return False
> > +
> > +        if not has_usb_ctrl():
> > +            ctrl = VirtualControllerUSB(self.conn)
> > +            self.add_device(ctrl)
> > +
> >          self._installer = virtinst.Installer.Installer(self.conn,
> >                                                     parsexmlnode=self._xml_node,
> >                                                     caps=caps)
> 
> This breaks a bunch of the unit tests (python setup.py test)

Argh..

> So prior to modeling a usb controller in the libvirt XML, how did
> this all
> work? Was libvirt unconditionally adding a USB1 controller to all
> qemu guests?

Yes, -usb was unconditionaly added.

> If so, libvirt should be adding a USB controller to the XML
> automatically and
> we shouldn't need to do that explicitly here (similar to how
> memballoon=virtio
> is always added for qemu guests, since we hardcoded it on qemu
> command line
> before we added XML to configure it).

Right, I can imagine how that would work. Daniel mentionned something similar some time ago, iirc.

regards




More information about the virt-tools-list mailing list