The helper returns the 'acpi' flag for a given machine type.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 16 ++++++++++++++++
src/qemu/qemu_capabilities.h | 3 +++
2 files changed, 19 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index b81fecc834..9aecd56c88 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2543,6 +2543,22 @@ virQEMUCapsIsMachineDeprecated(virQEMUCaps *qemuCaps,
}
+virTristateBool
+virQEMUCapsMachineSupportsACPI(virQEMUCaps *qemuCaps,
+ virDomainVirtType type,
+ const char *machine)
+{
+ virQEMUCapsAccel *accel = virQEMUCapsGetAccel(qemuCaps, type);
+ size_t i;
+
+ for (i = 0; i < accel->nmachineTypes; i++) {
+ if (STREQ_NULLABLE(accel->machineTypes[i].name, machine))
+ return accel->machineTypes[i].acpi;
+ }
+ return VIR_TRISTATE_BOOL_ABSENT;
+}
+
+
bool
virQEMUCapsGetMachineNumaMemSupported(virQEMUCaps *qemuCaps,
virDomainVirtType virtType,
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index d1b96e4fc5..fadb07706e 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -768,6 +768,9 @@ bool virQEMUCapsIsCPUDeprecated(virQEMUCaps *qemuCaps,
bool virQEMUCapsIsMachineDeprecated(virQEMUCaps *qemuCaps,
virDomainVirtType type,
const char *machine);
+virTristateBool virQEMUCapsMachineSupportsACPI(virQEMUCaps *qemuCaps,
+ virDomainVirtType type,
+ const char *machine);
bool virQEMUCapsGetMachineNumaMemSupported(virQEMUCaps *qemuCaps,
virDomainVirtType virtType,
const char *name);
--
2.39.2