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

Martin Kletzander mkletzan at redhat.com
Wed Sep 9 09:43:56 UTC 2015


On Wed, Sep 09, 2015 at 11:27:25AM +0300, Pavel Fedin wrote:
>Fixes the following error when attempting to add a disk with bus='virtio'
>to a machine which actually supports virtio-mmio (caught with ARM virt):
>
>virtio disk cannot have an address of type 'virtio-mmio'
>
>The problem has been likely introduced by
>e8d55172544c1fafe31a9e09346bdebca4f0d6f9. Before that
>qemuAssignDevicePCISlots() was never called for ARM "virt" machine.
>
>Signed-off-by: Pavel Fedin <p.fedin at samsung.com>
>---
>v1 => v2
>- Added check for QEMU_CAPS_DEVICE_VIRTIO_MMIO, this leaves the
>  error message for machines which actually do not support
>  virtio-mmio. In this case the user may still attempt to add
>  such a disk manually.
>---
> src/qemu/qemu_command.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
>diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
>index ec5e3d4..db21ee9 100644
>--- a/src/qemu/qemu_command.c
>+++ b/src/qemu/qemu_command.c
>@@ -2598,6 +2598,12 @@ qemuAssignDevicePCISlots(virDomainDefPtr def,
>             VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)
>             continue;
>
>+        /* Also ignore virtio-mmio disks if our machine allows them */
>+        if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO) &&
>+            def->disks[i]->info.type ==
>+            VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO)
>+            continue;
>+

There is no qemuCaps here, you have to pas it the whole way.

>         if (def->disks[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
>             virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
>                            _("virtio disk cannot have an address of type '%s'"),
>--
>1.9.5.msysgit.0
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150909/b925a50d/attachment-0001.sig>


More information about the libvir-list mailing list