[Engine-devel] [libvirt]Supporting native USB in oVirt

Daniel P. Berrange berrange at redhat.com
Thu May 10 13:05:11 UTC 2012


On Thu, May 10, 2012 at 02:12:42PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 05/10/2012 01:39 PM, Oved Ourfalli wrote:
> >Rephrasing my question a bit, to make it more clear.
> >We are now working on adding the support for native USB devices on oVirt.
> >
> >This requires adding composite PCI devices to a VM (details below), requiring specific set of restrictions on the addresses of these devices, and the connections between them.
> >Is it possible to add such a composite set of devices to a VM while using automatic address assignment, as we do today on the other PCI devices?
> 
> To be clear, what the ovirt-engine people want to do (AFAIK), is add an EHCI controller
> with UHCI companion controllers to a vm, which would normally be done in the xml file
> like this:
> 
>     <controller type='usb' index='0' model='ich9-ehci1'>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x7'/>
>     </controller>
>     <controller type='usb' index='0' model='ich9-uhci1'>
>       <master startport='0'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0' multifunction='on'/>
>     </controller>
>     <controller type='usb' index='0' model='ich9-uhci2'>
>       <master startport='2'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x1'/>
>     </controller>
>     <controller type='usb' index='0' model='ich9-uhci3'>
>       <master startport='4'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x2'/>
>     </controller>
> 
> Without manually specifying the addresses, ie they want to be able to write
> something like:
> 
>     <controller type='usb' index='0' model='ich9-ehci1'>
>     </controller>
>     <controller type='usb' index='0' model='ich9-uhci1'>
>       <master startport='0'/>
>     </controller>
>     <controller type='usb' index='0' model='ich9-uhci2'>
>       <master startport='2'/>
>     </controller>
>     <controller type='usb' index='0' model='ich9-uhci3'>
>       <master startport='4'/>
>     </controller>
> 
> Which currently does not work, and even if it would work
> libvirt does not seem to know that all devices here should
> share one pci slot using different functions of that slot
> (and the EHCI controller must have the highest function)
> 
> I can imagine a syntax like this:
> 
>     <controller type='usb' index='0' model='ich9-ehci1'>
>     </controller>
>     <controller type='usb' index='0' model='ich9-uhci1'>
>       <master id='usb' startport='0'/>
>     </controller>
>     <controller type='usb' index='0' model='ich9-uhci2'>
>       <master id='usb' startport='2'/>
>     </controller>
>     <controller type='usb' index='0' model='ich9-uhci3'>
>       <master id='usb' startport='4'/>
>     </controller>
> 
> Where the id='usb' tells libvirt which master usb controller
> the companions belong to, and that libvirt would then
> automatically assign them all the same pci-slot, with different
> function number, ensuring the EHCI device gets the highest
> function nr.

While I don't much fancy adding support for automatic
assignment with the companion controllers, we could probably
make it work, even without needing an extra 'id' attribute.
We'd just have to special-case handling of model names
uhci[1-3], and apply a first-match rule against ehci
controller, if there were multiple

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 Engine-devel mailing list