[libvirt] [PATCH v5 0/4] qemu: Allow PCI virtio on ARM "virt" machine

Laine Stump laine at laine.org
Tue Aug 11 19:02:59 UTC 2015


On 08/11/2015 01:51 PM, Cole Robinson wrote:
> On 07/17/2015 07:27 AM, Pavel Fedin wrote:
>> Virt machine in qemu since v2.3.0 has PCI generic host controller, and
>> can use PCI devices. This provides performance improvement as well as
>> vhost-net with irqfd support for virtio-net. However libvirt currently
>> does not allow ARM virt machine to have PCI devices. This patchset adds
>> the necessary support.
>>
>> Changes since v4:
>> - Rebased onto current master
>> - Added possibility to plug virtio-net-pci adapter directly into PCIe bus.
>>   This is necessary for irqfds to work in qemu.
>> Changes since v3:
>> - Capability is based not on qemu version but on support of "gpex-pcihost"
>>   device by qemu
>> - Added a workaround, allowing to pass "make check". The problem is that
>>   test suite does not build capabilities cache. Unfortunately this means
>>   that correct unit-test for the new functionality currently cannot be
>>   written. Test suite framework needs to be improved.
>> Changes since v2:
>> Complete rework, use different approach
>> - Correctly model PCI Express bus on the machine. It is now possible to
>>   explicitly specify <address-type='pci'> with attributes. This allows to
>>   attach not only virtio, but any other PCI device to the model.
>> - Default is not changed and still mmio, for backwards compatibility with
>>   existing installations. PCI bus has to be explicitly specified.
>> - Check for the capability in correct place, in v2 it actually did not
>>   work
>> Changes since v1:
>> - Added capability based on qemu version number
>> - Recognize also "virt-" prefix
>>
>> Pavel Fedin (4):
>>   qemu: Introduce QEMU_CAPS_OBJECT_GPEX
>>   Add PCI-Express root to ARM virt machine
>>   Build correct command line for PCI NICs on ARM
>>   Allow to plug virtio-net-pci into PCIe slot
> I was a bit confused about the patches that landed; I see now that they only
> add a PCI controller for modern -M virt, but don't change the virtio defaults
> to use it. This is good, and in my brief testing doesn't cause any regressions
> with current virt-manager. We can figure out later if/how to change the
> bus=virtio or model=virtio default to use PCI instead of virtio-mmio
>
> But yeah, we need to figure out that test case issue. There's already a
> regression with git head:
>
> $ sudo virsh create test-aarch64.xml
> error: Failed to create domain from test-aarch64.xml
> error: internal error: autogenerated dmi-to-pci-bridge options not set

Hah! So you see Martin and John, *that* is why I wanted all that "extra"
checking! :-)

> XML attached. I'm guessing this is one of Laine's patches, CCd

Actually the problem is that the original  hacks had yet another
function added in called qemuDomainSupportsPCI(), which is called during
PCI address assignment (also when the PCI controllers are setup), and
these new ARM PCI patches haven't added the new sauce to that function.

I just added the same bit of code checking for QEMU_CAPS_OBJECT_GPEX,
and your example now starts up with no problems.

I'm sending the patch now.




More information about the libvir-list mailing list