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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
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;
+
         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


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]