* [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces
@ 2014-06-05 14:36 Igor Mammedov
2014-06-05 14:36 ` [Qemu-devel] [PATCH 1/5] qmp: add query-memory-devices command Igor Mammedov
` (6 more replies)
0 siblings, 7 replies; 14+ messages in thread
From: Igor Mammedov @ 2014-06-05 14:36 UTC (permalink / raw)
To: qemu-devel; +Cc: pkrempa, mst, armbru, lcapitulino, vasilis.liaskovitis
this is implemented on top of v4 memory hotplug series:
http://lists.gnu.org/archive/html/qemu-devel/2014-06/msg00129.html
Series adds following QMP commands:
- query-memory-devices
- query-acpi-ospm-status
and event:
- ACPI_DEVICE_OST
Which could be used by management tools to query current
state of memory devices (implemented only for PCDIMMDevice so far)
and a related ACPI view of corresponding status of slots
(ACPI Memory Device objects).
git tree for testing:
https://github.com/imammedo/qemu/commits/memory-hotplug-OST
Igor Mammedov (5):
qmp: add query-memory-devices command
acpi: introduce TYPE_ACPI_DEVICE_IF interface
acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices
qmp: add query-acpi-ospm-status command
qmp: add ACPI_DEVICE_OST event handling
docs/qmp/qmp-events.txt | 10 ++++
hw/acpi/Makefile.objs | 1 +
hw/acpi/acpi_interface.c | 15 +++++
hw/acpi/ich9.c | 7 +++
hw/acpi/memory_hotplug.c | 60 +++++++++++++++++++++-
hw/acpi/piix4.c | 11 ++++
hw/isa/lpc_ich9.c | 3 +
hw/mem/pc-dimm.c | 39 ++++++++++++++
include/hw/acpi/acpi_dev_interface.h | 43 +++++++++++++++
include/hw/acpi/ich9.h | 3 +
include/hw/acpi/memory_hotplug.h | 1 +
include/hw/mem/pc-dimm.h | 2 +
include/monitor/monitor.h | 1 +
monitor.c | 1 +
qapi-schema.json | 94 ++++++++++++++++++++++++++++++++++
qmp-commands.hx | 49 ++++++++++++++++++
qmp.c | 31 +++++++++++
stubs/Makefile.objs | 1 +
stubs/qmp_pc_dimm_device_list.c | 7 +++
19 files changed, 378 insertions(+), 1 deletions(-)
create mode 100644 hw/acpi/acpi_interface.c
create mode 100644 include/hw/acpi/acpi_dev_interface.h
create mode 100644 stubs/qmp_pc_dimm_device_list.c
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH 1/5] qmp: add query-memory-devices command
2014-06-05 14:36 [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces Igor Mammedov
@ 2014-06-05 14:36 ` Igor Mammedov
2014-06-16 15:21 ` Eric Blake
2014-06-05 14:36 ` [Qemu-devel] [PATCH 2/5] acpi: introduce TYPE_ACPI_DEVICE_IF interface Igor Mammedov
` (5 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Igor Mammedov @ 2014-06-05 14:36 UTC (permalink / raw)
To: qemu-devel; +Cc: pkrempa, mst, armbru, lcapitulino, vasilis.liaskovitis
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 6456 bytes --]
... allowing to get state of present memory devices.
Currently implemented only for PCDIMMDevice.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v2:
* fix typos an json syntax in QMP example
* make 'id' optional to allow command work with
anonymous memory devices
---
hw/mem/pc-dimm.c | 39 ++++++++++++++++++++++++++++
include/hw/mem/pc-dimm.h | 2 +
qapi-schema.json | 53 +++++++++++++++++++++++++++++++++++++++
qmp-commands.hx | 27 ++++++++++++++++++++
qmp.c | 11 ++++++++
stubs/Makefile.objs | 1 +
stubs/qmp_pc_dimm_device_list.c | 7 +++++
7 files changed, 140 insertions(+), 0 deletions(-)
create mode 100644 stubs/qmp_pc_dimm_device_list.c
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 9f091c6..361071f 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -23,6 +23,45 @@
#include "qapi/visitor.h"
#include "qemu/range.h"
+int qmp_pc_dimm_device_list(Object *obj, void *opaque)
+{
+ MemoryDeviceInfoList ***prev = opaque;
+
+ if (object_dynamic_cast(obj, TYPE_PC_DIMM)) {
+ DeviceState *dev = DEVICE(obj);
+
+ if (dev->realized) {
+ MemoryDeviceInfoList *elem = g_new0(MemoryDeviceInfoList, 1);
+ MemoryDeviceInfo *info = g_new0(MemoryDeviceInfo, 1);
+ PCDIMMDeviceInfo *di = g_new0(PCDIMMDeviceInfo, 1);
+ DeviceClass *dc = DEVICE_GET_CLASS(obj);
+ PCDIMMDevice *dimm = PC_DIMM(obj);
+
+ if (dev->id) {
+ di->has_id = true;
+ di->id = g_strdup(dev->id);
+ }
+ di->hotplugged = dev->hotplugged;
+ di->hotpluggable = dc->hotpluggable;
+ di->addr = dimm->addr;
+ di->slot = dimm->slot;
+ di->node = dimm->node;
+ di->size = object_property_get_int(OBJECT(dimm), PC_DIMM_SIZE_PROP,
+ NULL);
+ di->memdev = object_get_canonical_path(OBJECT(dimm->hostmem));
+
+ info->dimm = di;
+ elem->value = info;
+ elem->next = NULL;
+ **prev = elem;
+ *prev = &elem->next;
+ }
+ }
+
+ object_child_foreach(obj, qmp_pc_dimm_device_list, opaque);
+ return 0;
+}
+
static int pc_dimm_slot2bitmap(Object *obj, void *opaque)
{
unsigned long *bitmap = opaque;
diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h
index 5f80d14..fa4cdd3 100644
--- a/include/hw/mem/pc-dimm.h
+++ b/include/hw/mem/pc-dimm.h
@@ -76,4 +76,6 @@ uint64_t pc_dimm_get_free_addr(uint64_t address_space_start,
Error **errp);
int pc_dimm_get_free_slot(const int *hint, int max_slots, Error **errp);
+
+int qmp_pc_dimm_device_list(Object *obj, void *opaque);
#endif
diff --git a/qapi-schema.json b/qapi-schema.json
index 7bc33ea..beb2de8 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -4722,3 +4722,56 @@
'btn' : 'InputBtnEvent',
'rel' : 'InputMoveEvent',
'abs' : 'InputMoveEvent' } }
+
+##
+# @PCDIMMDeviceInfo:
+#
+# PCDIMMDevice state information
+#
+# @id: the device's ID
+#
+# @addr: physical address, where device is mapped
+#
+# @size: size of memory device provides
+#
+# @slot: slot number at which device is plugged in
+#
+# @node: NUMA node number where device is plugged in
+#
+# @memdev: memory backend linked with device
+#
+# @hotplugged: true if device was hotplugged
+#
+# @hotpluggable: true if device if could be added/removed while machine is running
+#
+# Since: 2.1
+##
+{ 'type': 'PCDIMMDeviceInfo',
+ 'data': { '*id': 'str',
+ 'addr': 'int',
+ 'size': 'int',
+ 'slot': 'int',
+ 'node': 'int',
+ 'memdev': 'str',
+ 'hotplugged': 'bool',
+ 'hotpluggable': 'bool'
+ }
+}
+
+##
+# @MemoryDeviceInfo:
+#
+# Union containing information about a memory device
+#
+# Since: 2.1
+##
+{ 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
+
+##
+# @query-memory-devices
+#
+# Lists available memory devices and their state
+#
+# Since: 2.1
+##
+{ 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
diff --git a/qmp-commands.hx b/qmp-commands.hx
index d8aa4ed..c0e0d9e 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -3572,3 +3572,30 @@ Example:
} } ] }
EQMP
+
+ {
+ .name = "query-memory-devices",
+ .args_type = "",
+ .mhandler.cmd_new = qmp_marshal_input_query_memory_devices,
+ },
+
+SQMP
+@query-memory-devices
+--------------------
+
+Return a list of memory devices.
+
+Example:
+-> { "execute": "query-memory-devices" }
+<- { "return": [ { "data":
+ { "addr": 5368709120,
+ "hotpluggable": true,
+ "hotplugged": true,
+ "id": "d1",
+ "memdev": "/objects/memX",
+ "node": 0,
+ "size": 1073741824,
+ "slot": 0},
+ "type": "dimm"
+ } ] }
+EQMP
diff --git a/qmp.c b/qmp.c
index b722dbe..66d2d67 100644
--- a/qmp.c
+++ b/qmp.c
@@ -28,6 +28,7 @@
#include "qapi/qmp-input-visitor.h"
#include "hw/boards.h"
#include "qom/object_interfaces.h"
+#include "hw/mem/pc-dimm.h"
NameInfo *qmp_query_name(Error **errp)
{
@@ -628,3 +629,13 @@ void qmp_object_del(const char *id, Error **errp)
}
object_unparent(obj);
}
+
+MemoryDeviceInfoList *qmp_query_memory_devices(Error **errp)
+{
+ MemoryDeviceInfoList *head = NULL;
+ MemoryDeviceInfoList **prev = &head;
+
+ qmp_pc_dimm_device_list(qdev_get_machine(), &prev);
+
+ return head;
+}
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index d99e2b9..6a95122 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -29,3 +29,4 @@ stub-obj-y += vmstate.o
stub-obj-$(CONFIG_WIN32) += fd-register.o
stub-obj-y += cpus.o
stub-obj-y += kvm.o
+stub-obj-y += qmp_pc_dimm_device_list.o
diff --git a/stubs/qmp_pc_dimm_device_list.c b/stubs/qmp_pc_dimm_device_list.c
new file mode 100644
index 0000000..5cb220c
--- /dev/null
+++ b/stubs/qmp_pc_dimm_device_list.c
@@ -0,0 +1,7 @@
+#include "qom/object.h"
+#include "hw/mem/pc-dimm.h"
+
+int qmp_pc_dimm_device_list(Object *obj, void *opaque)
+{
+ return 0;
+}
--
1.7.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH 2/5] acpi: introduce TYPE_ACPI_DEVICE_IF interface
2014-06-05 14:36 [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces Igor Mammedov
2014-06-05 14:36 ` [Qemu-devel] [PATCH 1/5] qmp: add query-memory-devices command Igor Mammedov
@ 2014-06-05 14:36 ` Igor Mammedov
2014-06-16 15:32 ` Eric Blake
2014-06-05 14:36 ` [Qemu-devel] [PATCH 3/5] acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices Igor Mammedov
` (4 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Igor Mammedov @ 2014-06-05 14:36 UTC (permalink / raw)
To: qemu-devel; +Cc: pkrempa, mst, armbru, lcapitulino, vasilis.liaskovitis
... it will be used to abstract generic ACPI bits from
device that implements ACPI interface.
ACPIOSTInfo type is used for passing-through raw _OST
event/status codes reported by guest OS to a management
layer. It lets management tools to interpret values
as specified by ACPI spec if it interested in it.
QEMU doesn't encode these values as enum, since it
doesn't need to handle them and it allows interface
to scale well without any changes in QEMU while guest
OS and management evolves in time.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v2:
- fix doc comments, describe not described fields
- add slot-type field with DIMM type for now, which later
we could extend to PCI slots and probably to CPUs
- extend commit message describing why source/status
are raw integers vs enum.
---
hw/acpi/Makefile.objs | 1 +
hw/acpi/acpi_interface.c | 15 ++++++++++++
include/hw/acpi/acpi_dev_interface.h | 43 ++++++++++++++++++++++++++++++++++
qapi-schema.json | 31 ++++++++++++++++++++++++
4 files changed, 90 insertions(+), 0 deletions(-)
create mode 100644 hw/acpi/acpi_interface.c
create mode 100644 include/hw/acpi/acpi_dev_interface.h
diff --git a/hw/acpi/Makefile.objs b/hw/acpi/Makefile.objs
index 004e1b2..acd2389 100644
--- a/hw/acpi/Makefile.objs
+++ b/hw/acpi/Makefile.objs
@@ -1,2 +1,3 @@
common-obj-$(CONFIG_ACPI) += core.o piix4.o ich9.o pcihp.o cpu_hotplug.o
common-obj-$(CONFIG_ACPI) += memory_hotplug.o
+common-obj-$(CONFIG_ACPI) += acpi_interface.o
diff --git a/hw/acpi/acpi_interface.c b/hw/acpi/acpi_interface.c
new file mode 100644
index 0000000..c181bb2
--- /dev/null
+++ b/hw/acpi/acpi_interface.c
@@ -0,0 +1,15 @@
+#include "hw/acpi/acpi_dev_interface.h"
+#include "qemu/module.h"
+
+static void register_types(void)
+{
+ static const TypeInfo acpi_dev_if_info = {
+ .name = TYPE_ACPI_DEVICE_IF,
+ .parent = TYPE_INTERFACE,
+ .class_size = sizeof(AcpiDeviceIfClass),
+ };
+
+ type_register_static(&acpi_dev_if_info);
+}
+
+type_init(register_types)
diff --git a/include/hw/acpi/acpi_dev_interface.h b/include/hw/acpi/acpi_dev_interface.h
new file mode 100644
index 0000000..f245f8d
--- /dev/null
+++ b/include/hw/acpi/acpi_dev_interface.h
@@ -0,0 +1,43 @@
+#ifndef ACPI_DEV_INTERFACE_H
+#define ACPI_DEV_INTERFACE_H
+
+#include "qom/object.h"
+#include "qapi-types.h"
+
+#define TYPE_ACPI_DEVICE_IF "acpi-device-interface"
+
+#define ACPI_DEVICE_IF_CLASS(klass) \
+ OBJECT_CLASS_CHECK(AcpiDeviceIfClass, (klass), \
+ TYPE_ACPI_DEVICE_IF)
+#define ACPI_DEVICE_IF_GET_CLASS(obj) \
+ OBJECT_GET_CLASS(AcpiDeviceIfClass, (obj), \
+ TYPE_ACPI_DEVICE_IF)
+#define ACPI_DEVICE_IF(obj) \
+ INTERFACE_CHECK(AcpiDeviceIf, (obj), \
+ TYPE_ACPI_DEVICE_IF)
+
+
+typedef struct AcpiDeviceIf {
+ /* <private> */
+ Object Parent;
+} AcpiDeviceIf;
+
+/**
+ * AcpiDeviceIfClass:
+ *
+ * ospm_status: returns status of ACPI device objects, reported
+ * via _OST method if device supports it.
+ *
+ * Interface is designed for providing unified interface
+ * to generic ACPI functionality that could be used without
+ * knowledge about internals of actual device that implements
+ * ACPI interface.
+ */
+typedef struct AcpiDeviceIfClass {
+ /* <private> */
+ InterfaceClass parent_class;
+
+ /* <public> */
+ void (*ospm_status)(AcpiDeviceIf *adev, ACPIOSTInfoList ***list);
+} AcpiDeviceIfClass;
+#endif
diff --git a/qapi-schema.json b/qapi-schema.json
index beb2de8..6d5651e 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -4775,3 +4775,34 @@
# Since: 2.1
##
{ 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
+
+## @ACPISlotType
+#
+# @DIMM: memory slot
+#
+{ 'enum': 'ACPISlotType', 'data': [ 'DIMM' ] }
+
+## @ACPIOSTInfo
+#
+# OSPM Status Indication for a device
+# For description of possible values of @source and @status fields
+# see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
+#
+# @device: device ID accossiated with slot
+#
+# @slot: slot ID, unique per slot of a given @slot-type
+#
+# @slot-type: type of the slot
+#
+# @source: an integer containing the source event
+#
+# @status: an integer containing the status code
+#
+# Since: 2.1
+##
+{ 'type': 'ACPIOSTInfo',
+ 'data' : { '*device': 'str',
+ 'slot': 'str',
+ 'slot-type': 'ACPISlotType',
+ 'source': 'int',
+ 'status': 'int' } }
--
1.7.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH 3/5] acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices
2014-06-05 14:36 [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces Igor Mammedov
2014-06-05 14:36 ` [Qemu-devel] [PATCH 1/5] qmp: add query-memory-devices command Igor Mammedov
2014-06-05 14:36 ` [Qemu-devel] [PATCH 2/5] acpi: introduce TYPE_ACPI_DEVICE_IF interface Igor Mammedov
@ 2014-06-05 14:36 ` Igor Mammedov
2014-06-16 16:14 ` Eric Blake
2014-06-05 14:36 ` [Qemu-devel] [PATCH 4/5] qmp: add query-acpi-ospm-status command Igor Mammedov
` (3 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Igor Mammedov @ 2014-06-05 14:36 UTC (permalink / raw)
To: qemu-devel; +Cc: pkrempa, mst, armbru, lcapitulino, vasilis.liaskovitis
... using TYPE_ACPI_DEVICE_IF interface.
Which provides status reporting of ACPI declared memory devices
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v2:
- set slot-type to DIMM
- take into account that 'device' field could be optional
---
hw/acpi/ich9.c | 7 +++++++
hw/acpi/memory_hotplug.c | 31 +++++++++++++++++++++++++++++++
hw/acpi/piix4.c | 11 +++++++++++
hw/isa/lpc_ich9.c | 3 +++
include/hw/acpi/ich9.h | 3 +++
include/hw/acpi/memory_hotplug.h | 1 +
6 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 2f66524..b9ebf63 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -310,3 +310,10 @@ void ich9_pm_device_plug_cb(ICH9LPCPMRegs *pm, DeviceState *dev, Error **errp)
" type: %s", object_get_typename(OBJECT(dev)));
}
}
+
+void ich9_pm_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list)
+{
+ ICH9LPCState *s = ICH9_LPC_DEVICE(adev);
+
+ acpi_memory_ospm_status(&s->pm.acpi_memory_hotplug, list);
+}
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index 71c7a5e..e7009bc 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -4,6 +4,37 @@
#include "hw/boards.h"
#include "trace.h"
+static ACPIOSTInfo *acpi_memory_device_status(int slot, MemStatus *mdev)
+{
+ ACPIOSTInfo *info = g_new0(ACPIOSTInfo, 1);
+
+ info->slot_type = ACPI_SLOT_TYPE_DIMM;
+ info->slot = g_strdup_printf("%d", slot);
+ info->source = mdev->ost_event;
+ info->status = mdev->ost_status;
+ if (mdev->dimm) {
+ DeviceState *dev = DEVICE(mdev->dimm);
+ if (dev->id) {
+ info->device = g_strdup(dev->id);
+ info->has_device = true;
+ }
+ }
+ return info;
+}
+
+void acpi_memory_ospm_status(MemHotplugState *mem_st, ACPIOSTInfoList ***list)
+{
+ int i;
+
+ for (i = 0; i < mem_st->dev_count; i++) {
+ ACPIOSTInfoList *elem = g_new0(ACPIOSTInfoList, 1);
+ elem->value = acpi_memory_device_status(i, &mem_st->devs[i]);
+ elem->next = NULL;
+ **list = elem;
+ *list = &elem->next;
+ }
+}
+
static uint64_t acpi_memory_hotplug_read(void *opaque, hwaddr addr,
unsigned int size)
{
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index 7473485..6e2587f 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -35,6 +35,7 @@
#include "hw/hotplug.h"
#include "hw/mem/pc-dimm.h"
#include "hw/acpi/memory_hotplug.h"
+#include "hw/acpi/acpi_dev_interface.h"
//#define DEBUG
@@ -574,6 +575,13 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,
}
}
+static void piix4_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list)
+{
+ PIIX4PMState *s = PIIX4_PM(adev);
+
+ acpi_memory_ospm_status(&s->acpi_memory_hotplug, list);
+}
+
static Property piix4_pm_properties[] = {
DEFINE_PROP_UINT32("smb_io_base", PIIX4PMState, smb_io_base, 0),
DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 0),
@@ -591,6 +599,7 @@ static void piix4_pm_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(klass);
+ AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_CLASS(klass);
k->init = piix4_pm_initfn;
k->config_write = pm_write_config;
@@ -609,6 +618,7 @@ static void piix4_pm_class_init(ObjectClass *klass, void *data)
dc->hotpluggable = false;
hc->plug = piix4_device_plug_cb;
hc->unplug = piix4_device_unplug_cb;
+ adevc->ospm_status = piix4_ospm_status;
}
static const TypeInfo piix4_pm_info = {
@@ -618,6 +628,7 @@ static const TypeInfo piix4_pm_info = {
.class_init = piix4_pm_class_init,
.interfaces = (InterfaceInfo[]) {
{ TYPE_HOTPLUG_HANDLER },
+ { TYPE_ACPI_DEVICE_IF },
{ }
}
};
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index 2adf29a..048653d 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -657,6 +657,7 @@ static void ich9_lpc_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(klass);
+ AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_CLASS(klass);
set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
dc->reset = ich9_lpc_reset;
@@ -675,6 +676,7 @@ static void ich9_lpc_class_init(ObjectClass *klass, void *data)
dc->cannot_instantiate_with_device_add_yet = true;
hc->plug = ich9_device_plug_cb;
hc->unplug = ich9_device_unplug_cb;
+ adevc->ospm_status = ich9_pm_ospm_status;
}
static const TypeInfo ich9_lpc_info = {
@@ -685,6 +687,7 @@ static const TypeInfo ich9_lpc_info = {
.class_init = ich9_lpc_class_init,
.interfaces = (InterfaceInfo[]) {
{ TYPE_HOTPLUG_HANDLER },
+ { TYPE_ACPI_DEVICE_IF },
{ }
}
};
diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
index 1977f1b..7e42448 100644
--- a/include/hw/acpi/ich9.h
+++ b/include/hw/acpi/ich9.h
@@ -24,6 +24,7 @@
#include "hw/acpi/acpi.h"
#include "hw/acpi/cpu_hotplug.h"
#include "hw/acpi/memory_hotplug.h"
+#include "hw/acpi/acpi_dev_interface.h"
typedef struct ICH9LPCPMRegs {
/*
@@ -59,4 +60,6 @@ extern const VMStateDescription vmstate_ich9_pm;
void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp);
void ich9_pm_device_plug_cb(ICH9LPCPMRegs *pm, DeviceState *dev, Error **errp);
+
+void ich9_pm_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list);
#endif /* HW_ACPI_ICH9_H */
diff --git a/include/hw/acpi/memory_hotplug.h b/include/hw/acpi/memory_hotplug.h
index 4588459..7bbf8a0 100644
--- a/include/hw/acpi/memory_hotplug.h
+++ b/include/hw/acpi/memory_hotplug.h
@@ -34,4 +34,5 @@ extern const VMStateDescription vmstate_memory_hotplug;
VMSTATE_STRUCT(memhp, state, 1, \
vmstate_memory_hotplug, MemHotplugState)
+void acpi_memory_ospm_status(MemHotplugState *mem_st, ACPIOSTInfoList ***list);
#endif
--
1.7.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH 4/5] qmp: add query-acpi-ospm-status command
2014-06-05 14:36 [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces Igor Mammedov
` (2 preceding siblings ...)
2014-06-05 14:36 ` [Qemu-devel] [PATCH 3/5] acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices Igor Mammedov
@ 2014-06-05 14:36 ` Igor Mammedov
2014-06-16 16:19 ` Eric Blake
2014-06-05 14:36 ` [Qemu-devel] [PATCH 5/5] qmp: add ACPI_DEVICE_OST event handling Igor Mammedov
` (2 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Igor Mammedov @ 2014-06-05 14:36 UTC (permalink / raw)
To: qemu-devel; +Cc: pkrempa, mst, armbru, lcapitulino, vasilis.liaskovitis
... to get ACPI OSPM status reported by ACPI devices
via _OST method.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
qapi-schema.json | 10 ++++++++++
qmp-commands.hx | 22 ++++++++++++++++++++++
qmp.c | 20 ++++++++++++++++++++
3 files changed, 52 insertions(+), 0 deletions(-)
diff --git a/qapi-schema.json b/qapi-schema.json
index 6d5651e..39052ae 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -4806,3 +4806,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-commands.hx b/qmp-commands.hx
index c0e0d9e..1a0cfb3 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -3599,3 +3599,25 @@ Example:
"type": "dimm"
} ] }
EQMP
+
+ {
+ .name = "query-acpi-ospm-status",
+ .args_type = "",
+ .mhandler.cmd_new = qmp_marshal_input_query_acpi_ospm_status,
+ },
+
+SQMP
+@query-acpi-ospm-status
+--------------------
+
+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
diff --git a/qmp.c b/qmp.c
index 66d2d67..3adcc6a 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;
+}
--
1.7.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH 5/5] qmp: add ACPI_DEVICE_OST event handling
2014-06-05 14:36 [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces Igor Mammedov
` (3 preceding siblings ...)
2014-06-05 14:36 ` [Qemu-devel] [PATCH 4/5] qmp: add query-acpi-ospm-status command Igor Mammedov
@ 2014-06-05 14:36 ` Igor Mammedov
2014-06-16 16:25 ` Eric Blake
2014-06-16 15:03 ` [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces Igor Mammedov
2014-06-16 15:30 ` Michael S. Tsirkin
6 siblings, 1 reply; 14+ messages in thread
From: Igor Mammedov @ 2014-06-05 14:36 UTC (permalink / raw)
To: qemu-devel; +Cc: pkrempa, mst, armbru, lcapitulino, vasilis.liaskovitis
emmits event when ACPI OSPM evaluates _OST method
of ACPI device.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v2:
- move event decription at the beginning of file
to preserve alphabet ordering in file
- fix example json
---
docs/qmp/qmp-events.txt | 10 ++++++++++
hw/acpi/memory_hotplug.c | 29 ++++++++++++++++++++++++++++-
include/monitor/monitor.h | 1 +
monitor.c | 1 +
4 files changed, 40 insertions(+), 1 deletions(-)
diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt
index 145402e..019db53 100644
--- a/docs/qmp/qmp-events.txt
+++ b/docs/qmp/qmp-events.txt
@@ -1,6 +1,16 @@
QEMU Machine Protocol Events
============================
+ACPI_DEVICE_OST
+---------------
+
+Emitted when guest executes ACPI _OST method.
+
+ - data: ACPIOSTInfo type as described in qapi-schema.json
+
+{ "event": "ACPI_DEVICE_OST",
+ "data": { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0 } }
+
BALLOON_CHANGE
--------------
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index e7009bc..de4ddc2 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -3,6 +3,10 @@
#include "hw/mem/pc-dimm.h"
#include "hw/boards.h"
#include "trace.h"
+#include "qapi-visit.h"
+#include "monitor/monitor.h"
+#include "qapi/dealloc-visitor.h"
+#include "qapi/qmp-output-visitor.h"
static ACPIOSTInfo *acpi_memory_device_status(int slot, MemStatus *mdev)
{
@@ -35,6 +39,29 @@ void acpi_memory_ospm_status(MemHotplugState *mem_st, ACPIOSTInfoList ***list)
}
}
+static void acpi_memory_ost_mon_event(const MemHotplugState *mem_st)
+{
+ Visitor *v;
+ QObject *out_info;
+ QapiDeallocVisitor *md;
+ QmpOutputVisitor *mo = qmp_output_visitor_new();
+ MemStatus *mdev = &mem_st->devs[mem_st->selector];
+ ACPIOSTInfo *info = acpi_memory_device_status(mem_st->selector, mdev);
+
+ v = qmp_output_get_visitor(mo);
+ visit_type_ACPIOSTInfo(v, &info, "unused", NULL);
+
+ out_info = qmp_output_get_qobject(mo);
+ monitor_protocol_event(QEVENT_ACPI_OST, out_info);
+ qobject_decref(out_info);
+
+ qmp_output_visitor_cleanup(mo);
+ md = qapi_dealloc_visitor_new();
+ v = qapi_dealloc_get_visitor(md);
+ visit_type_ACPIOSTInfo(v, &info, "unused", NULL);
+ qapi_dealloc_visitor_cleanup(md);
+}
+
static uint64_t acpi_memory_hotplug_read(void *opaque, hwaddr addr,
unsigned int size)
{
@@ -119,8 +146,8 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data,
mdev = &mem_st->devs[mem_st->selector];
mdev->ost_status = data;
trace_mhp_acpi_write_ost_status(mem_st->selector, mdev->ost_status);
- /* TODO: report async error */
/* TODO: implement memory removal on guest signal */
+ acpi_memory_ost_mon_event(mem_st);
break;
case 0x14:
mdev = &mem_st->devs[mem_st->selector];
diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
index 1c1f56f..97696ea 100644
--- a/include/monitor/monitor.h
+++ b/include/monitor/monitor.h
@@ -51,6 +51,7 @@ typedef enum MonitorEvent {
QEVENT_BLOCK_IMAGE_CORRUPTED,
QEVENT_QUORUM_FAILURE,
QEVENT_QUORUM_REPORT_BAD,
+ QEVENT_ACPI_OST,
/* Add to 'monitor_event_names' array in monitor.c when
* defining new events here */
diff --git a/monitor.c b/monitor.c
index 593679a..c9717c2 100644
--- a/monitor.c
+++ b/monitor.c
@@ -485,6 +485,7 @@ static const char *monitor_event_names[] = {
[QEVENT_BLOCK_IMAGE_CORRUPTED] = "BLOCK_IMAGE_CORRUPTED",
[QEVENT_QUORUM_FAILURE] = "QUORUM_FAILURE",
[QEVENT_QUORUM_REPORT_BAD] = "QUORUM_REPORT_BAD",
+ [QEVENT_ACPI_OST] = "ACPI_DEVICE_OST",
};
QEMU_BUILD_BUG_ON(ARRAY_SIZE(monitor_event_names) != QEVENT_MAX)
--
1.7.1
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces
2014-06-05 14:36 [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces Igor Mammedov
` (4 preceding siblings ...)
2014-06-05 14:36 ` [Qemu-devel] [PATCH 5/5] qmp: add ACPI_DEVICE_OST event handling Igor Mammedov
@ 2014-06-16 15:03 ` Igor Mammedov
2014-06-16 15:30 ` Michael S. Tsirkin
6 siblings, 0 replies; 14+ messages in thread
From: Igor Mammedov @ 2014-06-16 15:03 UTC (permalink / raw)
To: qemu-devel; +Cc: lcapitulino, mst
On Thu, 5 Jun 2014 16:36:03 +0200
Igor Mammedov <imammedo@redhat.com> wrote:
> this is implemented on top of v4 memory hotplug series:
> http://lists.gnu.org/archive/html/qemu-devel/2014-06/msg00129.html
>
> Series adds following QMP commands:
> - query-memory-devices
> - query-acpi-ospm-status
> and event:
> - ACPI_DEVICE_OST
>
> Which could be used by management tools to query current
> state of memory devices (implemented only for PCDIMMDevice so far)
> and a related ACPI view of corresponding status of slots
> (ACPI Memory Device objects).
ping
>
> git tree for testing:
> https://github.com/imammedo/qemu/commits/memory-hotplug-OST
>
> Igor Mammedov (5):
> qmp: add query-memory-devices command
> acpi: introduce TYPE_ACPI_DEVICE_IF interface
> acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices
> qmp: add query-acpi-ospm-status command
> qmp: add ACPI_DEVICE_OST event handling
>
> docs/qmp/qmp-events.txt | 10 ++++
> hw/acpi/Makefile.objs | 1 +
> hw/acpi/acpi_interface.c | 15 +++++
> hw/acpi/ich9.c | 7 +++
> hw/acpi/memory_hotplug.c | 60 +++++++++++++++++++++-
> hw/acpi/piix4.c | 11 ++++
> hw/isa/lpc_ich9.c | 3 +
> hw/mem/pc-dimm.c | 39 ++++++++++++++
> include/hw/acpi/acpi_dev_interface.h | 43 +++++++++++++++
> include/hw/acpi/ich9.h | 3 +
> include/hw/acpi/memory_hotplug.h | 1 +
> include/hw/mem/pc-dimm.h | 2 +
> include/monitor/monitor.h | 1 +
> monitor.c | 1 +
> qapi-schema.json | 94 ++++++++++++++++++++++++++++++++++
> qmp-commands.hx | 49 ++++++++++++++++++
> qmp.c | 31 +++++++++++
> stubs/Makefile.objs | 1 +
> stubs/qmp_pc_dimm_device_list.c | 7 +++
> 19 files changed, 378 insertions(+), 1 deletions(-)
> create mode 100644 hw/acpi/acpi_interface.c
> create mode 100644 include/hw/acpi/acpi_dev_interface.h
> create mode 100644 stubs/qmp_pc_dimm_device_list.c
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH 1/5] qmp: add query-memory-devices command
2014-06-05 14:36 ` [Qemu-devel] [PATCH 1/5] qmp: add query-memory-devices command Igor Mammedov
@ 2014-06-16 15:21 ` Eric Blake
0 siblings, 0 replies; 14+ messages in thread
From: Eric Blake @ 2014-06-16 15:21 UTC (permalink / raw)
To: Igor Mammedov, qemu-devel
Cc: vasilis.liaskovitis, lcapitulino, pkrempa, armbru, mst
[-- Attachment #1: Type: text/plain, Size: 2432 bytes --]
On 06/05/2014 08:36 AM, Igor Mammedov wrote:
> ... allowing to get state of present memory devices.
> Currently implemented only for PCDIMMDevice.
>
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
> v2:
> * fix typos an json syntax in QMP example
> * make 'id' optional to allow command work with
> anonymous memory devices
> ---
> hw/mem/pc-dimm.c | 39 ++++++++++++++++++++++++++++
> include/hw/mem/pc-dimm.h | 2 +
> qapi-schema.json | 53 +++++++++++++++++++++++++++++++++++++++
> qmp-commands.hx | 27 ++++++++++++++++++++
> qmp.c | 11 ++++++++
> stubs/Makefile.objs | 1 +
> stubs/qmp_pc_dimm_device_list.c | 7 +++++
> 7 files changed, 140 insertions(+), 0 deletions(-)
> create mode 100644 stubs/qmp_pc_dimm_device_list.c
>
> +++ b/qapi-schema.json
> @@ -4722,3 +4722,56 @@
> 'btn' : 'InputBtnEvent',
> 'rel' : 'InputMoveEvent',
> 'abs' : 'InputMoveEvent' } }
> +
> +##
> +# @PCDIMMDeviceInfo:
> +#
> +# PCDIMMDevice state information
> +#
> +# @id: the device's ID
Might be worth annotating this as #optional
> +#
> +# @addr: physical address, where device is mapped
> +#
> +# @size: size of memory device provides
grammar reads awkwardly; maybe 's/device/that the device/
> +{ 'type': 'PCDIMMDeviceInfo',
> + 'data': { '*id': 'str',
> + 'addr': 'int',
> + 'size': 'int',
> + 'slot': 'int',
> + 'node': 'int',
> + 'memdev': 'str',
> + 'hotplugged': 'bool',
> + 'hotpluggable': 'bool'
> + }
> +}
Looks okay.
> +
> +##
> +# @MemoryDeviceInfo:
> +#
> +# Union containing information about a memory device
> +#
> +# Since: 2.1
> +##
> +{ 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
> +
This command works, but it is a bit verbose. A flat union would be a
bit more compact over the wire, but we don't yet have support for a flat
union with an empty base class. So I'll live with this.
The two tweaks to the .json file only affect comments, so they are minor
enough that I'm okay with:
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces
2014-06-05 14:36 [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces Igor Mammedov
` (5 preceding siblings ...)
2014-06-16 15:03 ` [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces Igor Mammedov
@ 2014-06-16 15:30 ` Michael S. Tsirkin
6 siblings, 0 replies; 14+ messages in thread
From: Michael S. Tsirkin @ 2014-06-16 15:30 UTC (permalink / raw)
To: Igor Mammedov
Cc: pkrempa, armbru, qemu-devel, vasilis.liaskovitis, lcapitulino
On Thu, Jun 05, 2014 at 04:36:03PM +0200, Igor Mammedov wrote:
> this is implemented on top of v4 memory hotplug series:
> http://lists.gnu.org/archive/html/qemu-devel/2014-06/msg00129.html
>
> Series adds following QMP commands:
> - query-memory-devices
> - query-acpi-ospm-status
> and event:
> - ACPI_DEVICE_OST
>
> Which could be used by management tools to query current
> state of memory devices (implemented only for PCDIMMDevice so far)
> and a related ACPI view of corresponding status of slots
> (ACPI Memory Device objects).
>
> git tree for testing:
> https://github.com/imammedo/qemu/commits/memory-hotplug-OST
Could you please address Eric's comments
(once all of them are in) and rebase
on top of latest?
I think these will be ok post soft freeze.
Thanks.
> Igor Mammedov (5):
> qmp: add query-memory-devices command
> acpi: introduce TYPE_ACPI_DEVICE_IF interface
> acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices
> qmp: add query-acpi-ospm-status command
> qmp: add ACPI_DEVICE_OST event handling
>
> docs/qmp/qmp-events.txt | 10 ++++
> hw/acpi/Makefile.objs | 1 +
> hw/acpi/acpi_interface.c | 15 +++++
> hw/acpi/ich9.c | 7 +++
> hw/acpi/memory_hotplug.c | 60 +++++++++++++++++++++-
> hw/acpi/piix4.c | 11 ++++
> hw/isa/lpc_ich9.c | 3 +
> hw/mem/pc-dimm.c | 39 ++++++++++++++
> include/hw/acpi/acpi_dev_interface.h | 43 +++++++++++++++
> include/hw/acpi/ich9.h | 3 +
> include/hw/acpi/memory_hotplug.h | 1 +
> include/hw/mem/pc-dimm.h | 2 +
> include/monitor/monitor.h | 1 +
> monitor.c | 1 +
> qapi-schema.json | 94 ++++++++++++++++++++++++++++++++++
> qmp-commands.hx | 49 ++++++++++++++++++
> qmp.c | 31 +++++++++++
> stubs/Makefile.objs | 1 +
> stubs/qmp_pc_dimm_device_list.c | 7 +++
> 19 files changed, 378 insertions(+), 1 deletions(-)
> create mode 100644 hw/acpi/acpi_interface.c
> create mode 100644 include/hw/acpi/acpi_dev_interface.h
> create mode 100644 stubs/qmp_pc_dimm_device_list.c
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH 2/5] acpi: introduce TYPE_ACPI_DEVICE_IF interface
2014-06-05 14:36 ` [Qemu-devel] [PATCH 2/5] acpi: introduce TYPE_ACPI_DEVICE_IF interface Igor Mammedov
@ 2014-06-16 15:32 ` Eric Blake
0 siblings, 0 replies; 14+ messages in thread
From: Eric Blake @ 2014-06-16 15:32 UTC (permalink / raw)
To: Igor Mammedov, qemu-devel
Cc: vasilis.liaskovitis, lcapitulino, pkrempa, armbru, mst
[-- Attachment #1: Type: text/plain, Size: 2383 bytes --]
On 06/05/2014 08:36 AM, Igor Mammedov wrote:
> ... it will be used to abstract generic ACPI bits from
> device that implements ACPI interface.
>
> ACPIOSTInfo type is used for passing-through raw _OST
> event/status codes reported by guest OS to a management
> layer. It lets management tools to interpret values
s/to //
> as specified by ACPI spec if it interested in it.
s/if it/if it is/
>
> QEMU doesn't encode these values as enum, since it
> doesn't need to handle them and it allows interface
> to scale well without any changes in QEMU while guest
> OS and management evolves in time.
>
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
> v2:
> - fix doc comments, describe not described fields
> - add slot-type field with DIMM type for now, which later
> we could extend to PCI slots and probably to CPUs
> - extend commit message describing why source/status
> are raw integers vs enum.
> ---
> hw/acpi/Makefile.objs | 1 +
> hw/acpi/acpi_interface.c | 15 ++++++++++++
> include/hw/acpi/acpi_dev_interface.h | 43 ++++++++++++++++++++++++++++++++++
> qapi-schema.json | 31 ++++++++++++++++++++++++
> 4 files changed, 90 insertions(+), 0 deletions(-)
> create mode 100644 hw/acpi/acpi_interface.c
> create mode 100644 include/hw/acpi/acpi_dev_interface.h
>
> +## @ACPIOSTInfo
> +#
> +# OSPM Status Indication for a device
> +# For description of possible values of @source and @status fields
> +# see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
> +#
> +# @device: device ID accossiated with slot
s/accossiated/associated/
Missing #optional annotation
> +#
> +# @slot: slot ID, unique per slot of a given @slot-type
> +#
> +# @slot-type: type of the slot
> +#
> +# @source: an integer containing the source event
> +#
> +# @status: an integer containing the status code
> +#
> +# Since: 2.1
> +##
> +{ 'type': 'ACPIOSTInfo',
> + 'data' : { '*device': 'str',
> + 'slot': 'str',
> + 'slot-type': 'ACPISlotType',
> + 'source': 'int',
> + 'status': 'int' } }
>
Fix the docs, and you can add:
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH 3/5] acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices
2014-06-05 14:36 ` [Qemu-devel] [PATCH 3/5] acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices Igor Mammedov
@ 2014-06-16 16:14 ` Eric Blake
2014-06-16 16:42 ` Igor Mammedov
0 siblings, 1 reply; 14+ messages in thread
From: Eric Blake @ 2014-06-16 16:14 UTC (permalink / raw)
To: Igor Mammedov, qemu-devel
Cc: vasilis.liaskovitis, lcapitulino, pkrempa, armbru, mst
[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]
On 06/05/2014 08:36 AM, Igor Mammedov wrote:
> ... using TYPE_ACPI_DEVICE_IF interface.
> Which provides status reporting of ACPI declared memory devices
>
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
> v2:
> - set slot-type to DIMM
> - take into account that 'device' field could be optional
> ---
> hw/acpi/ich9.c | 7 +++++++
> hw/acpi/memory_hotplug.c | 31 +++++++++++++++++++++++++++++++
> hw/acpi/piix4.c | 11 +++++++++++
> hw/isa/lpc_ich9.c | 3 +++
> include/hw/acpi/ich9.h | 3 +++
> include/hw/acpi/memory_hotplug.h | 1 +
> 6 files changed, 56 insertions(+), 0 deletions(-)
>
> +void acpi_memory_ospm_status(MemHotplugState *mem_st, ACPIOSTInfoList ***list);
Triple indirection looks unusual, but that doesn't make it wrong :)
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH 4/5] qmp: add query-acpi-ospm-status command
2014-06-05 14:36 ` [Qemu-devel] [PATCH 4/5] qmp: add query-acpi-ospm-status command Igor Mammedov
@ 2014-06-16 16:19 ` Eric Blake
0 siblings, 0 replies; 14+ messages in thread
From: Eric Blake @ 2014-06-16 16:19 UTC (permalink / raw)
To: Igor Mammedov, qemu-devel
Cc: vasilis.liaskovitis, lcapitulino, pkrempa, armbru, mst
[-- Attachment #1: Type: text/plain, Size: 542 bytes --]
On 06/05/2014 08:36 AM, Igor Mammedov wrote:
> ... to get ACPI OSPM status reported by ACPI devices
> via _OST method.
>
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
> qapi-schema.json | 10 ++++++++++
> qmp-commands.hx | 22 ++++++++++++++++++++++
> qmp.c | 20 ++++++++++++++++++++
> 3 files changed, 52 insertions(+), 0 deletions(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH 5/5] qmp: add ACPI_DEVICE_OST event handling
2014-06-05 14:36 ` [Qemu-devel] [PATCH 5/5] qmp: add ACPI_DEVICE_OST event handling Igor Mammedov
@ 2014-06-16 16:25 ` Eric Blake
0 siblings, 0 replies; 14+ messages in thread
From: Eric Blake @ 2014-06-16 16:25 UTC (permalink / raw)
To: Igor Mammedov, qemu-devel
Cc: pkrempa, mst, armbru, lcapitulino, vasilis.liaskovitis,
Wenchao Xia
[-- Attachment #1: Type: text/plain, Size: 1161 bytes --]
On 06/05/2014 08:36 AM, Igor Mammedov wrote:
> emmits event when ACPI OSPM evaluates _OST method
s/emmits/emits/
> of ACPI device.
>
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
> v2:
> - move event decription at the beginning of file
s/decription/description/ (but typos in the changelog don't matter :)
> to preserve alphabet ordering in file
> - fix example json
> ---
> docs/qmp/qmp-events.txt | 10 ++++++++++
> hw/acpi/memory_hotplug.c | 29 ++++++++++++++++++++++++++++-
> include/monitor/monitor.h | 1 +
> monitor.c | 1 +
> 4 files changed, 40 insertions(+), 1 deletions(-)
It's a race to see whether this gets merged first, or whether Wenchao's
event-as-QAPI series gets merged first (still waiting for v7 on that
series; v6 was here[1]). Loser has to rebase :)
[1]https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg01222.html
If this goes in first, and you can fix the typo in the commit message,
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH 3/5] acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices
2014-06-16 16:14 ` Eric Blake
@ 2014-06-16 16:42 ` Igor Mammedov
0 siblings, 0 replies; 14+ messages in thread
From: Igor Mammedov @ 2014-06-16 16:42 UTC (permalink / raw)
To: Eric Blake
Cc: pkrempa, mst, qemu-devel, armbru, lcapitulino,
vasilis.liaskovitis
On Mon, 16 Jun 2014 10:14:16 -0600
Eric Blake <eblake@redhat.com> wrote:
> On 06/05/2014 08:36 AM, Igor Mammedov wrote:
> > ... using TYPE_ACPI_DEVICE_IF interface.
> > Which provides status reporting of ACPI declared memory devices
> >
> > Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> > ---
> > v2:
> > - set slot-type to DIMM
> > - take into account that 'device' field could be optional
> > ---
> > hw/acpi/ich9.c | 7 +++++++
> > hw/acpi/memory_hotplug.c | 31 +++++++++++++++++++++++++++++++
> > hw/acpi/piix4.c | 11 +++++++++++
> > hw/isa/lpc_ich9.c | 3 +++
> > include/hw/acpi/ich9.h | 3 +++
> > include/hw/acpi/memory_hotplug.h | 1 +
> > 6 files changed, 56 insertions(+), 0 deletions(-)
> >
>
> > +void acpi_memory_ospm_status(MemHotplugState *mem_st, ACPIOSTInfoList ***list);
>
> Triple indirection looks unusual, but that doesn't make it wrong :)
I plan to move ACPI code inside of interface handlers and drop piix4/ich9 stubs
in favor of using QOM casting directly. So it would be -1 layer of indirection and
not only for ospm_status().
In addition interface allows to avoid adding global function + stub where
functionality is not implemented.
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2014-06-16 16:42 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-05 14:36 [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces Igor Mammedov
2014-06-05 14:36 ` [Qemu-devel] [PATCH 1/5] qmp: add query-memory-devices command Igor Mammedov
2014-06-16 15:21 ` Eric Blake
2014-06-05 14:36 ` [Qemu-devel] [PATCH 2/5] acpi: introduce TYPE_ACPI_DEVICE_IF interface Igor Mammedov
2014-06-16 15:32 ` Eric Blake
2014-06-05 14:36 ` [Qemu-devel] [PATCH 3/5] acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices Igor Mammedov
2014-06-16 16:14 ` Eric Blake
2014-06-16 16:42 ` Igor Mammedov
2014-06-05 14:36 ` [Qemu-devel] [PATCH 4/5] qmp: add query-acpi-ospm-status command Igor Mammedov
2014-06-16 16:19 ` Eric Blake
2014-06-05 14:36 ` [Qemu-devel] [PATCH 5/5] qmp: add ACPI_DEVICE_OST event handling Igor Mammedov
2014-06-16 16:25 ` Eric Blake
2014-06-16 15:03 ` [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces Igor Mammedov
2014-06-16 15:30 ` Michael S. Tsirkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).