[libvirt] [PATCH 02/12] qemu: caps: Tweak arm conditional in SupportsChardev

Cole Robinson crobinso at redhat.com
Mon Jun 26 18:01:43 UTC 2017


Rather than try to whitelist all device configs that can't use
-chardev, blacklist the only one that really can't, which is the
default serial/console target type=isa case.

ISA specifically isn't a valid config for arm/aarch64, but we've
always implicitly treated it to mean 'default platform device'.

Signed-off-by: Cole Robinson <crobinso at redhat.com>
---
 src/qemu/qemu_capabilities.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 61c9a1066..d0bc50bd7 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -5568,17 +5568,22 @@ virQEMUCapsSupportsChardev(const virDomainDef *def,
         if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
             chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO)
             return false;
+        return true;
     }
 
-    if ((def->os.arch != VIR_ARCH_ARMV7L) && (def->os.arch != VIR_ARCH_AARCH64))
+    if ((def->os.arch == VIR_ARCH_ARMV7L) ||
+        (def->os.arch == VIR_ARCH_AARCH64)) {
+        /* TARGET_TYPE_ISA here really means 'the default', which we
+           treat as whatever the built in platform serial device is on.
+           And for platform devices we can't use -chardev */
+        if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
+            chr->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA)
+            return false;
+
         return true;
+    }
 
-    /* This may not be true for all ARM machine types, but at least
-     * the only supported non-virtio serial devices of vexpress and versatile
-     * don't have the -chardev property wired up. */
-    return (chr->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO ||
-            (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE &&
-             chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO));
+    return true;
 }
 
 
-- 
2.13.0




More information about the libvir-list mailing list