Signed-off-by: Tobin Feldman-Fitzthum <tobin@xxxxxxxxxxxxxxxxxx> --- src/qemu/qemu_capabilities.c | 14 ++++++++++++++ src/qemu/qemu_capabilities.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index c56b2d8f0e..8a17287076 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4984,6 +4984,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_DISABLED)) + type = VIR_DOMAIN_VIRT_QEMU; + else + type = VIR_DOMAIN_VIRT_NONE; + + return type; +} + int virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, qemuMonitorPtr mon) diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index abc4ee82cb..9a779912fe 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -636,6 +636,8 @@ int virQEMUCapsGetCPUFeatures(virQEMUCapsPtr qemuCaps, bool migratable, char ***features); +virDomainVirtType virQEMUCapsGetVirtType(virQEMUCapsPtr qemuCaps); + bool virQEMUCapsIsArchSupported(virQEMUCapsPtr qemuCaps, virArch arch); bool virQEMUCapsIsVirtTypeSupported(virQEMUCapsPtr qemuCaps, -- 2.20.1 (Apple Git-117)