[libvirt] [PATCH] QEMU: Fix virtio-serial device support on PPC.

Olivia Yin Hong-Hua.Yin at freescale.com
Wed Jun 25 10:31:43 UTC 2014


Patch fd0f22ed414e114664f4140306834bedd19f52c9 discard virtio-serial
device support on PPC machine.

Most PPC boards don't use -chardev with non-virtio serial device
except pseries which uses -device spapr-vty with -chardev.

Signed-off-by: Olivia Yin <Hong-Hua.Yin at freescale.com>
---
 src/qemu/qemu_capabilities.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 8e0a550..4541f52 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -3493,19 +3493,18 @@ virQEMUCapsSupportsChardev(virDomainDefPtr def,
         !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE))
         return false;
 
-    if ((def->os.arch == VIR_ARCH_PPC) || (def->os.arch == VIR_ARCH_PPC64)) {
-        /* only pseries need -device spapr-vty with -chardev */
-        return (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
-                chr->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO);
-    }
-
-    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) &&
+        (def->os.arch != VIR_ARCH_PPC) && (def->os.arch != VIR_ARCH_PPC64))
         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. */
+    /* Currently PPC boards don't use -chardev for non-virtio serial device
+     * except pseries which uses -device spapr-vty with -chardev. */
     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));
+             chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO) ||
+            (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL &&
+             chr->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO));
 }
-- 
1.8.5




More information about the libvir-list mailing list