提交 00ea049d 编写于 作者: T Tobin Feldman-Fitzthum 提交者: Michal Privoznik

qemu: Fix capabilities probing with TCG

Only probe QEMU binary with accel=tcg if TCG is not disabled.
Similarly, only add a VIR_DOMAIN_VIRT_QEMU guest if TCG
is available.
Signed-off-by: NTobin Feldman-Fitzthum <tobin@linux.vnet.ibm.com>
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 5ffff9b9
...@@ -1021,13 +1021,16 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps, ...@@ -1021,13 +1021,16 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
virCapabilitiesAddGuestFeatureWithToggle(guest, VIR_CAPS_GUEST_FEATURE_TYPE_DISKSNAPSHOT, virCapabilitiesAddGuestFeatureWithToggle(guest, VIR_CAPS_GUEST_FEATURE_TYPE_DISKSNAPSHOT,
true, false); true, false);
if (virCapabilitiesAddGuestDomain(guest, if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_TCG)) {
VIR_DOMAIN_VIRT_QEMU, if (virCapabilitiesAddGuestDomain(guest,
NULL, VIR_DOMAIN_VIRT_QEMU,
NULL, NULL,
0, NULL,
NULL) == NULL) 0,
goto cleanup; NULL) == NULL) {
goto cleanup;
}
}
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) { if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) {
if (virCapabilitiesAddGuestDomain(guest, if (virCapabilitiesAddGuestDomain(guest,
...@@ -2307,7 +2310,8 @@ bool ...@@ -2307,7 +2310,8 @@ bool
virQEMUCapsIsVirtTypeSupported(virQEMUCapsPtr qemuCaps, virQEMUCapsIsVirtTypeSupported(virQEMUCapsPtr qemuCaps,
virDomainVirtType virtType) virDomainVirtType virtType)
{ {
if (virtType == VIR_DOMAIN_VIRT_QEMU) if (virtType == VIR_DOMAIN_VIRT_QEMU &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_TCG))
return true; return true;
if (virtType == VIR_DOMAIN_VIRT_KVM && if (virtType == VIR_DOMAIN_VIRT_KVM &&
...@@ -5166,6 +5170,7 @@ virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps, ...@@ -5166,6 +5170,7 @@ virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps,
* off. * off.
*/ */
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) && if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_TCG) &&
virQEMUCapsInitQMPSingle(qemuCaps, libDir, runUid, runGid, true) < 0) virQEMUCapsInitQMPSingle(qemuCaps, libDir, runUid, runGid, true) < 0)
return -1; return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册