[libvirt] [PATCH] Allow virtio-console on PPC64

virQEMUCapsSupportsChardev existing checks returns true for spapr-vty alone. Instead verify spapr-vty validity and let the logic to return true for other device types so that virtio-console passes. The non-pseries machines dont have spapr-vio-bus. So, the function always returned false for them before. Fixes - https://bugzilla.redhat.com/show_bug.cgi?id=1257813 Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com> --- src/qemu/qemu_capabilities.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 6eee85d..784496b 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4286,9 +4286,12 @@ virQEMUCapsSupportsChardev(const virDomainDef *def, return false; if ((def->os.arch == VIR_ARCH_PPC) || ARCH_IS_PPC64(def->os.arch)) { + if (!qemuDomainMachineIsPSeries(def)) + return false; /* 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 (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && + chr->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO) + return false; } if ((def->os.arch != VIR_ARCH_ARMV7L) && (def->os.arch != VIR_ARCH_AARCH64))

On Wed, 2016-10-19 at 18:59 +0530, Shivaprasad G Bhat wrote:
virQEMUCapsSupportsChardev existing checks returns true for spapr-vty alone. Instead verify spapr-vty validity and let the logic to return true for other device types so that virtio-console passes. The non-pseries machines dont have spapr-vio-bus. So, the function always returned false for them before. Fixes - https://bugzilla.redhat.com/show_bug.cgi?id=1257813 Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com> --- src/qemu/qemu_capabilities.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
I finally got around to review this, sorry for the delay. There is definitely some cleaning up to do in the part of libvirt your patch touches, but the fix works and doesn't affect other architectures so there's no point in holding it off any longer. ACK and pushed. -- Andrea Bolognani / Red Hat / Virtualization
participants (2)
-
Andrea Bolognani
-
Shivaprasad G Bhat