[libvirt] [PATCH v3 11/18] qemu: assign virtio devices to PCIe slot when appropriate

Alex Williamson alex.williamson at redhat.com
Tue Nov 15 17:44:23 UTC 2016


On Tue, 15 Nov 2016 13:21:21 +0100
Andrea Bolognani <abologna at redhat.com> wrote:

> On Thu, 2016-10-06 at 10:34 -0400, Laine Stump wrote:
> > > > +    <video>
> > > > +      <model type='virtio' heads='1' primary='yes'/>
> > > > +      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>  
> > > 
> > > I was initially baffled by this, because I expected it to
> > > be assigned to one of the available pcie-root-ports just
> > > like all the other virtio devices.
> > > 
> > > However, according to qemuDomainValidateDevicePCISlotsQ35()
> > > this is intentional, so I guess we're good :)  
>> > Actually, you bring up an interesting point in light of the "Should PCIe 
> > devices ever be placed directly on pcie-root?" debate on qemu-devel (I 
> > think it was in the thread about the PCI topology document that Marcel 
> > is writing). We currently always put the primary video device at 00:1 
> > just because "we always have", and it has the nice side effect of 
> > eliminating the need for legacy-PCI controllers. But in this one case 
> > the device is PCIe - to follow Marcel's recommendation of putting only 
> > legacy devices on pcie-root, we should be putting the virtio video 
> > device on a root-port.
>> > As I recall, Marcel and Alex were the most vocal on this subject, so I'm 
> > Cc'ing them, with this bit of context - this patch auto-assigns the 
> > addresses for virtio devices to be on Express ports rather than legacy 
> > slots when appropriate, but there is a bit of Q35-specific code that 
> > overrides any of that and always places the primary video device at 
> > 00:01.0 - should we still do that for the primary video if it's virtio? 
> > Or should we put it behind a root-port?  
> 
> I don't think we ever got a reply... Bump? :)

The primary reason you're putting the device under a pcie-root-port is
for hotplug, right?  How many users care about hotplug of primary
video?  How many guest operating systems even support that?  I'd feel
pretty comfortable making the primary graphics non-hotpluggable by
default.  I actually lean towards making the user specify if they care
about hotplugging a device rather than assuming they do, seems like we
impose a lot of complexity on our configurations for something that
might actually be a niche feature.  Thanks,

Alex




More information about the libvir-list mailing list