mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
qmp: add query-acpi-ospm-status command
... to get ACPI OSPM status reported by ACPI devices via _OST method. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
43f5041008
commit
02419bcb3f
3 changed files with 52 additions and 0 deletions
20
qmp.c
20
qmp.c
|
@ -29,6 +29,7 @@
|
|||
#include "hw/boards.h"
|
||||
#include "qom/object_interfaces.h"
|
||||
#include "hw/mem/pc-dimm.h"
|
||||
#include "hw/acpi/acpi_dev_interface.h"
|
||||
|
||||
NameInfo *qmp_query_name(Error **errp)
|
||||
{
|
||||
|
@ -639,3 +640,22 @@ MemoryDeviceInfoList *qmp_query_memory_devices(Error **errp)
|
|||
|
||||
return head;
|
||||
}
|
||||
|
||||
ACPIOSTInfoList *qmp_query_acpi_ospm_status(Error **errp)
|
||||
{
|
||||
bool ambig;
|
||||
ACPIOSTInfoList *head = NULL;
|
||||
ACPIOSTInfoList **prev = &head;
|
||||
Object *obj = object_resolve_path_type("", TYPE_ACPI_DEVICE_IF, &ambig);
|
||||
|
||||
if (obj) {
|
||||
AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_GET_CLASS(obj);
|
||||
AcpiDeviceIf *adev = ACPI_DEVICE_IF(obj);
|
||||
|
||||
adevc->ospm_status(adev, &prev);
|
||||
} else {
|
||||
error_setg(errp, "command is not supported, missing ACPI device");
|
||||
}
|
||||
|
||||
return head;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue