----- Original Message -----
From: "Daniel P. Berrange" <berrange(a)redhat.com>
To: "Hans de Goede" <hdegoede(a)redhat.com>
Cc: "Oved Ourfalli" <ovedo(a)redhat.com>, "engine-devel"
<engine-devel(a)ovirt.org>, libvirt-list(a)redhat.com
Sent: Thursday, May 10, 2012 4:05:11 PM
Subject: Re: [Engine-devel] [libvirt]Supporting native USB in oVirt
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
That would be very helpful indeed.
We would need something similar for the redirect devices, as they also requiring their
address to be assigned to the same bus as the controllers.