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

Laine Stump laine at laine.org
Tue Nov 15 16:15:06 UTC 2016


On 11/15/2016 07:21 AM, Andrea Bolognani 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? :)

I looked at "lspci" of a guest that has virtio-gpu directly connected to 
pci-root, and found that it does show up as a legacy device in that 
case, which I guess is what we want, right?

Let's ask the author of virtio-gpu: Gerd, what is your opinion - when 
using virtio-gpu as the primary video device, is it better to have it 
directly plugged into 00:01.0 (i.e. a legacy integrated device)? Or is 
it better to plug it into a pcie-root-port?




More information about the libvir-list mailing list