[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 102/103] qmp: add query-acpi-ospm-status command
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 102/103] qmp: add query-acpi-ospm-status command |
Date: |
Tue, 17 Jun 2014 20:42:35 +0300 |
From: Igor Mammedov <address@hidden>
... to get ACPI OSPM status reported by ACPI devices
via _OST method.
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Acked-by: Michael S. Tsirkin <address@hidden>
---
qapi-schema.json | 10 ++++++++++
qmp.c | 20 ++++++++++++++++++++
qmp-commands.hx | 22 ++++++++++++++++++++++
3 files changed, 52 insertions(+)
diff --git a/qapi-schema.json b/qapi-schema.json
index 8179c79..58751e0 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -4918,3 +4918,13 @@
'slot-type': 'ACPISlotType',
'source': 'int',
'status': 'int' } }
+
+##
+# @query-acpi-ospm-status
+#
+# Lists ACPI OSPM status of ACPI device objects,
+# which might be reported via _OST method
+#
+# Since: 2.1
+##
+{ 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
diff --git a/qmp.c b/qmp.c
index 835fd78..dca6efb 100644
--- a/qmp.c
+++ b/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;
+}
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 177ac25..fa037bf 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -3637,3 +3637,25 @@ Example:
"type": "dimm"
} ] }
EQMP
+
+ {
+ .name = "query-acpi-ospm-status",
+ .args_type = "",
+ .mhandler.cmd_new = qmp_marshal_input_query_acpi_ospm_status,
+ },
+
+SQMP
address@hidden
+--------------------
+
+Return list of ACPIOSTInfo for devices that support status reporting
+via ACPI _OST method.
+
+Example:
+-> { "execute": "query-acpi-ospm-status" }
+<- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source":
1, "status": 0},
+ { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
+ { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
+ { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
+ ]}
+EQMP
--
MST
- [Qemu-devel] [PULL 095/103] qdev: recursively unrealize devices when unrealizing bus, (continued)
- [Qemu-devel] [PULL 095/103] qdev: recursively unrealize devices when unrealizing bus, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 096/103] qmp: clean out whitespace, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 048/103] Add G_IO_HUP handler for socket chardev, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 063/103] NUMA: check if the total numa memory size is equal to ram_size, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 064/103] NUMA: Add numa_info structure to contain numa nodes info, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 099/103] qmp: add query-memory-devices command, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 100/103] acpi: introduce TYPE_ACPI_DEVICE_IF interface, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 062/103] NUMA: move numa related code to new file numa.c, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 097/103] pc: acpi: do not hardcode preprocessor, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 098/103] numa: handle mmaped memory allocation failure correctly, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 102/103] qmp: add query-acpi-ospm-status command,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 036/103] virtio: Drop superfluous conditionals around g_free(), Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 088/103] qmp: add query-memdev, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 034/103] acpi: update generated files, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 060/103] libqemustub: add stubs to be able to use qemu-char.c, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 068/103] qmp: improve error reporting for -object and object-add, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 035/103] acpi-test: update expected tables, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 086/103] hostmem: add property to map memory with MAP_SHARED, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 046/103] Add chardev API qemu_chr_fe_set_msgfds, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 087/103] hostmem: add properties for NUMA memory policy, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 103/103] qmp: add ACPI_DEVICE_OST event handling, Michael S. Tsirkin, 2014/06/17