From: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
On architectures not supporting the Intel specific programmable interval
timer, like e.g. S390, starting a domain with a clock definition containing
a pit timer results in the error "Option no-kvm-pit-reinjection not supported
for this target".
By moving the capability enablement for -no-kvm-pit-reinjection from the
InitQMPBasic section into the x86_64 and i686 only enablement section all
other architectures are no longer automatically enabled. In addition
architecture related capabilities enablements were refactored into a new
architecture bound capabilities initialization function.
Signed-off-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
src/qemu/qemu_capabilities.c | 55 ++++++++++++++++++++++++++++--------------
1 file changed, 37 insertions(+), 18 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index a95f23c..028e77c 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2367,13 +2367,48 @@ virQEMUCapsInitQMPBasic(virQEMUCapsPtr qemuCaps)
virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_USER_CONFIG);
virQEMUCapsSet(qemuCaps, QEMU_CAPS_NETDEV_BRIDGE);
virQEMUCapsSet(qemuCaps, QEMU_CAPS_SECCOMP_SANDBOX);
- virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_KVM_PIT);
virQEMUCapsSet(qemuCaps, QEMU_CAPS_DTB);
virQEMUCapsSet(qemuCaps, QEMU_CAPS_IPV6_MIGRATION);
virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_OPT);
virQEMUCapsSet(qemuCaps, QEMU_CAPS_DUMP_GUEST_CORE);
}
+/* Capabilities that are architecture depending
+ * initialized for QEMU.
+ */
+static int
+virQEMUCapsInitArchQMPBasic(virQEMUCapsPtr qemuCaps,
+ qemuMonitorPtr mon)
+{
+ char *archstr = NULL;
+ int ret = -1;
+
+ if (!(archstr = qemuMonitorGetTargetArch(mon)))
+ return -1;
+
+ if ((qemuCaps->arch = virQEMUCapsArchFromString(archstr)) == VIR_ARCH_NONE) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown QEMU arch %s"), archstr);
+ goto cleanup;
+ }
+
+ /*
+ * Currently only x86_64 and i686 support PCI-multibus,
+ * -no-acpi and -no-kvm-pit-reinjection.
+ */
+ if (qemuCaps->arch == VIR_ARCH_X86_64 ||
+ qemuCaps->arch == VIR_ARCH_I686) {
+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS);
+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_ACPI);
+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_KVM_PIT);
+ }
+
+ ret = 0;
+
+cleanup:
+ VIR_FREE(archstr);
+ return ret;
+}
static int
virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps,
@@ -2391,7 +2426,6 @@ virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps,
char *monarg = NULL;
char *monpath = NULL;
char *pidfile = NULL;
- char *archstr;
pid_t pid = 0;
virDomainObj vm;
@@ -2508,23 +2542,8 @@ virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps,
if (qemuCaps->version >= 1003000)
virQEMUCapsSet(qemuCaps, QEMU_CAPS_MACHINE_USB_OPT);
- if (!(archstr = qemuMonitorGetTargetArch(mon)))
- goto cleanup;
-
- if ((qemuCaps->arch = virQEMUCapsArchFromString(archstr)) == VIR_ARCH_NONE) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Unknown QEMU arch %s"), archstr);
- VIR_FREE(archstr);
+ if (virQEMUCapsInitArchQMPBasic(qemuCaps, mon) < 0)
goto cleanup;
- }
- VIR_FREE(archstr);
-
- /* Currently only x86_64 and i686 support PCI-multibus and -no-acpi. */
- if (qemuCaps->arch == VIR_ARCH_X86_64 ||
- qemuCaps->arch == VIR_ARCH_I686) {
- virQEMUCapsSet(qemuCaps, QEMU_CAPS_PCI_MULTIBUS);
- virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_ACPI);
- }
if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0)
goto cleanup;
--
1.7.9.5
Show replies by date