提交 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,
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册