The helper returns the 'acpi' flag for a given machine type. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- 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 b387988b26..a498f449ea 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2542,6 +2542,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 d049f79dd9..a7fba4dfa6 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -767,6 +767,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