From 593639ffffa43f52aae53038bc8bd75ec700b12f Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Wed, 15 Nov 2017 18:08:44 +0100 Subject: [PATCH] qemu: add QEMU_CAPS_DEVICE_SCLPLMCONSOLE Add a separate capability for the sclplmconsole device, and check it specifically instead of using QEMU_CAPS_DEVICE_SCLPCONSOLE for that too. Signed-off-by: Pino Toscano Reviewed-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 4 ++++ src/qemu/qemu_capabilities.h | 3 +++ src/qemu/qemu_command.c | 22 ++++++++++++++++++- .../caps_2.10.0.s390x.xml | 1 + .../qemucapabilitiesdata/caps_2.7.0.s390x.xml | 1 + .../qemucapabilitiesdata/caps_2.8.0.s390x.xml | 1 + .../qemucapabilitiesdata/caps_2.9.0.s390x.xml | 1 + 7 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index f6e06d3e9e..d65e26b45d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -446,6 +446,9 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "machine.pseries.resize-hpt", "vmcoreinfo", "spapr-vty", + + /* 275 */ + "sclplmconsole", ); @@ -1675,6 +1678,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "spapr-pci-host-bridge", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE }, { "vmcoreinfo", QEMU_CAPS_DEVICE_VMCOREINFO }, { "spapr-vty", QEMU_CAPS_DEVICE_SPAPR_VTY }, + { "sclplmconsole", QEMU_CAPS_DEVICE_SCLPLMCONSOLE }, }; static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 5ab1227696..daeb6294cc 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -433,6 +433,9 @@ typedef enum { QEMU_CAPS_DEVICE_VMCOREINFO, /* -device vmcoreinfo */ QEMU_CAPS_DEVICE_SPAPR_VTY, /* -device spapr-vty */ + /* 275 */ + QEMU_CAPS_DEVICE_SCLPLMCONSOLE, /* -device sclplmconsole */ + QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index abff418afc..836e40e590 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9307,7 +9307,6 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManager, switch (console->targetType) { case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP: - case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLPLM: if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SCLPCONSOLE)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("sclpconsole is not supported in this QEMU binary")); @@ -9328,6 +9327,27 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManager, return -1; break; + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLPLM: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SCLPLMCONSOLE)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("sclplmconsole is not supported in this QEMU binary")); + return -1; + } + + if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, cfg, def, + console->source, + console->info.alias, + qemuCaps, true, + chardevStdioLogd))) + return -1; + virCommandAddArg(cmd, "-chardev"); + virCommandAddArg(cmd, devstr); + VIR_FREE(devstr); + + if (qemuBuildChrDeviceCommandLine(cmd, def, console, qemuCaps) < 0) + return -1; + break; + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO: if (!(devstr = qemuBuildChrChardevStr(logManager, cmd, cfg, def, console->source, diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml index 7e44652feb..dee468252c 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml @@ -141,6 +141,7 @@ + 2010000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml index c5dfa2a9d0..c2f310cd46 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml @@ -135,6 +135,7 @@ + 2007000 0 diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml index 6d26896ef9..f6e024dc61 100644 --- a/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml @@ -137,6 +137,7 @@ + 2007093 0 diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml index 896ed503c3..6f965997ec 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml @@ -138,6 +138,7 @@ + 2009000 0