提交 856587ea 编写于 作者: T Tobin Feldman-Fitzthum 提交者: Michal Privoznik

qemu: Add virQEMUCapsGetVirtType convenience function

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>
上级 00ea049d
......@@ -4999,6 +4999,20 @@ virQEMUCapsProbeQMPSchemaCapabilities(virQEMUCapsPtr qemuCaps,
#define QEMU_MIN_MINOR 5
#define QEMU_MIN_MICRO 0
virDomainVirtType
virQEMUCapsGetVirtType(virQEMUCapsPtr qemuCaps)
{
virDomainVirtType type;
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM))
type = VIR_DOMAIN_VIRT_KVM;
else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_TCG))
type = VIR_DOMAIN_VIRT_QEMU;
else
type = VIR_DOMAIN_VIRT_NONE;
return type;
}
int
virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
qemuMonitorPtr mon)
......@@ -5043,11 +5057,7 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
if (virQEMUCapsProbeQMPKVMState(qemuCaps, mon) < 0)
return -1;
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM))
type = VIR_DOMAIN_VIRT_KVM;
else
type = VIR_DOMAIN_VIRT_QEMU;
type = virQEMUCapsGetVirtType(qemuCaps);
accel = virQEMUCapsGetAccel(qemuCaps, type);
if (virQEMUCapsProbeQMPEvents(qemuCaps, mon) < 0)
......@@ -5540,10 +5550,7 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache,
goto cleanup;
}
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM))
capsType = VIR_DOMAIN_VIRT_KVM;
else
capsType = VIR_DOMAIN_VIRT_QEMU;
capsType = virQEMUCapsGetVirtType(qemuCaps);
if (virttype == VIR_DOMAIN_VIRT_NONE)
virttype = capsType;
......
......@@ -642,6 +642,8 @@ int virQEMUCapsGetCPUFeatures(virQEMUCapsPtr qemuCaps,
bool migratable,
char ***features);
virDomainVirtType virQEMUCapsGetVirtType(virQEMUCapsPtr qemuCaps);
bool virQEMUCapsIsArchSupported(virQEMUCapsPtr qemuCaps,
virArch arch);
bool virQEMUCapsIsVirtTypeSupported(virQEMUCapsPtr qemuCaps,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册