diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 4a6662b31fe3d41d92b414c06bdcd437f192c083..2c63506214a46cc4f86694595bcb6f35f202d462 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1021,13 +1021,16 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps, virCapabilitiesAddGuestFeatureWithToggle(guest, VIR_CAPS_GUEST_FEATURE_TYPE_DISKSNAPSHOT, true, false); - if (virCapabilitiesAddGuestDomain(guest, - VIR_DOMAIN_VIRT_QEMU, - NULL, - NULL, - 0, - NULL) == NULL) - goto cleanup; + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_TCG)) { + if (virCapabilitiesAddGuestDomain(guest, + VIR_DOMAIN_VIRT_QEMU, + NULL, + NULL, + 0, + NULL) == NULL) { + goto cleanup; + } + } if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { if (virCapabilitiesAddGuestDomain(guest, @@ -2307,7 +2310,8 @@ bool virQEMUCapsIsVirtTypeSupported(virQEMUCapsPtr qemuCaps, virDomainVirtType virtType) { - if (virtType == VIR_DOMAIN_VIRT_QEMU) + if (virtType == VIR_DOMAIN_VIRT_QEMU && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_TCG)) return true; if (virtType == VIR_DOMAIN_VIRT_KVM && @@ -5166,6 +5170,7 @@ virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps, * off. */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_TCG) && virQEMUCapsInitQMPSingle(qemuCaps, libDir, runUid, runGid, true) < 0) return -1;