[libvirt] [PATCH] Ignore virtio-mmio disks in qemuAssignDevicePCISlots()

Pavel Fedin p.fedin at samsung.com
Wed Sep 9 06:38:44 UTC 2015


 Hello!

> How did you manage to do that?

 Probably i forgot to explicitly specify that it affects ARM 'virt' machine. Before we added PCIe
support we were able to use only virtio-mmio there. Now we can use both, because virtio-mmio support
in qemu didn't go anywhere.
 It worked before PCIe support introduction just because qemuAssignDevicePCISlots() was never
called.

>  I think we are not handlind virtio-mmio addressing properly as we won't add some controller qemu
> will then be missing.  Shouldn't that be fixed as well?

 Didn't understand exactly what you mean, but <address type='virtio-mmio'/> perfectly works. Even
more, this is the default on ARM for backwards compatibility, as we decided before. virtio-mmio is
assigned either manually or automatically for certain device kinds by
qemuDomainAssignARMVirtioMMIOAddresses(). After it, qemuDomainAssignPCIAddresses() is called, which
before PCIe introduction just did nothing. Now it tries to assign PCI addresses to anything which
still doesn't have addresses at all. For the majority of devices it checks only for info.type !=
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE, but for VirtIO disks it is a bit more picky for some reason.

 The problem is easy to reproduce with virt-manager. Just try to add a disk (or modify existing
disk) and specify bus = virtio. By default, since we now have PCIe, it will add virtio-scsi disk on
top of SCSI controller, so the default works flawlessly. Because virtio-scsi != virtio-block.

>  And isn't virtio-mmio only supported on some platforms?

 Yes. But for platforms where virtio-mmio is not supported we can not get
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO addresses, because
qemuDomainAssignARMVirtioMMIOAddresses() will not do anything, because QEMU_CAPS_DEVICE_VIRTIO_MMIO
will not be set.

Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia





More information about the libvir-list mailing list