Probe for TCG with QMP right after probing for KVM.
Signed-off-by: Tobin Feldman-Fitzthum <tobin(a)linux.vnet.ibm.com>
---
src/qemu/qemu_capabilities.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 0b44ee0745..528bf6e504 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2554,6 +2554,38 @@ virQEMUCapsProbeQMPGenericProps(virQEMUCapsPtr qemuCaps,
return 0;
}
+static int
+virQEMUCapsProbeQMPTCGState(virQEMUCapsPtr qemuCaps,
+ qemuMonitorPtr mon)
+{
+ int nvalues;
+ char **values;
+ size_t i;
+ bool found = false;
+ /*
+ * As of version 2.10, QEMU can be built without the TCG.
+ * */
+ if (qemuCaps->version < 2010000)
+ return 0;
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM))
+ return 0;
+ if ((nvalues = qemuMonitorGetObjectTypes(mon, &values)) < 0)
+ return -1;
+
+ for (i = 0; i < nvalues; i++) {
+ if (STREQ(values[i], "tcg-accel")) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found)
+ virQEMUCapsSet(qemuCaps, QEMU_CAPS_TCG_DISABLED);
+
+ virStringListFreeCount(values, nvalues);
+ return 0;
+}
+
static int
virQEMUCapsProbeQMPDevices(virQEMUCapsPtr qemuCaps,
qemuMonitorPtr mon)
--
2.20.1 (Apple Git-117)