[libvirt] [PATCH] Set a sensible default master start port for ehci companion controllers

Oved Ourfalli ovedo at redhat.com
Tue May 15 11:22:52 UTC 2012


You're right.
I used an old VM and it didn't work well (VM from early dev phase for this feature).

I created a new one.
First time I run it, it works.
The second time, in which we pass the address (as we store it in the ovirt engine database), I get the following XML:
                <controller index="0" model="ich9-uhci1" type="usb">
                        <master startport="0"/>
                        <address  domain="0x0000"  function="0x2"  slot="0x04"  type="pci" bus="0x00"/>
                </controller>
                <controller index="0" model="ich9-ehci1" type="usb">
                        <address  domain="0x0000"  function="0x2"  slot="0x04"  type="pci" bus="0x00"/>
                </controller>
                <controller index="0" model="ich9-uhci3" type="usb">
                        <master startport="4"/>
                        <address  domain="0x0000"  function="0x2"  slot="0x04"  type="pci" bus="0x00"/>
                </controller>
                <controller index="0" model="ich9-uhci2" type="usb">
                        <master startport="2"/>
                        <address  domain="0x0000"  function="0x2"  slot="0x04"  type="pci" bus="0x00"/>
                </controller>

And I get the following error:
XML error: Attempted double use of PCI Address '0:0:4.2' (may need "multifunction='on'" for device on function 0)

It is weird that the functions above are not as expected from your source code. Also, the multifunction isn't set to on.
But, they were okay in the first time, otherwise it wouldn't have worked.

Any suggestions?

Thank you,
Oved
----- Original Message -----
> From: "Daniel P. Berrange" <berrange at redhat.com>
> To: "Oved Ourfalli" <ovedo at redhat.com>
> Cc: "Hans de Goede" <hdegoede at redhat.com>, libvir-list at redhat.com
> Sent: Tuesday, May 15, 2012 12:40:12 PM
> Subject: Re: [PATCH] Set a sensible default master start port for ehci companion controllers
> 
> On Tue, May 15, 2012 at 05:25:23AM -0400, Oved Ourfalli wrote:
> > -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2
> > -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x4.0x7
> > -device
> > ich9-usb-uhci1,masterbus=usb.0,firstport=0,bus=pci.0,multifunction=on,addr=0x4
> > -device
> > ich9-usb-uhci2,masterbus=usb.0,firstport=2,bus=pci.0,addr=0x4.0x1
> > -device
> > ich9-usb-uhci3,masterbus=usb.0,firstport=4,bus=pci.0,addr=0x4.0x2
> 
> Here we see the problem - we have a USB1 controller (piix3-usb0-uhci)
> and the USB2 controller + companions.
> 
> Both the USB1 & USB2 controller are getting the same name.
> 
> >                 <controller type="usb">
> >                         <address  domain="0x0000"  function="0x2"
> >                          slot="0x01"  type="pci" bus="0x00"/>
> >                 </controller>
> 
> Here you have requested the USB1 controller (defaults to
> piix3-usb-uhci)
> but ommitted the index= attribute, so it defaults to 0.
> 
> >                 <controller index="0" model="ich9-ehci1"
> >                 type="usb"/>
> 
> And here you have requested USB2 controller also with index=0.
> 
> >                 <controller index="0" model="ich9-uhci1"
> >                 type="usb">
> >                         <master startport="0"/>
> >                 </controller>
> >                 <controller index="0" model="ich9-uhci2"
> >                 type="usb">
> >                         <master startport="2"/>
> >                 </controller>
> >                 <controller index="0" model="ich9-uhci3"
> >                 type="usb">
> >                         <master startport="4"/>
> >                 </controller>
> 
> And these are the companions - it is correct that these have the same
> index as the master controller.
> 
> 
> Libvirt really ought to have raised an error about your XML with the
> duplicated index for USB1 and USB2 controllers. Of course you can
> just remove the USB1 controller from your XML and avoid the issue,
> since the companions provide USB1 compatibility
> 
> 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