qemu: capabilities: Introduce virQEMUCapsMachineSupportsACPI

The helper returns the 'acpi' flag for a given machine type.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2023-02-27 15:44:57 +01:00
parent 795642b985
commit cbdaf87f96
2 changed files with 19 additions and 0 deletions

View File

@ -2540,6 +2540,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,

View File

@ -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);