qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3] qmp: add ACPI_DEVICE_OST event handling
@ 2014-06-20  8:33 Igor Mammedov
  2014-06-20 15:46 ` Eric Blake
  2014-06-22  5:58 ` Michael S. Tsirkin
  0 siblings, 2 replies; 8+ messages in thread
From: Igor Mammedov @ 2014-06-20  8:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: wenchaoqemu, mst

emits event when ACPI OSPM evaluates _OST method
of ACPI device.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v2:
 - use new QAPI event infrastructure
      from rebased PCI tree on top of today's QMP pull request
---
 hw/acpi/memory_hotplug.c |    7 ++++++-
 qapi-event.json          |   10 ++++++++++
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index e7009bc..38ca415 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -3,6 +3,7 @@
 #include "hw/mem/pc-dimm.h"
 #include "hw/boards.h"
 #include "trace.h"
+#include "qapi-event.h"
 
 static ACPIOSTInfo *acpi_memory_device_status(int slot, MemStatus *mdev)
 {
@@ -88,6 +89,7 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data,
 {
     MemHotplugState *mem_st = opaque;
     MemStatus *mdev;
+    ACPIOSTInfo *info;
 
     if (!mem_st->dev_count) {
         return;
@@ -119,8 +121,11 @@ 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 */
+
+        info = acpi_memory_device_status(mem_st->selector, mdev);
+        qapi_event_send_acpi_device_ost(info, &error_abort);
+        qapi_free_ACPIOSTInfo(info);
         break;
     case 0x14:
         mdev = &mem_st->devs[mem_st->selector];
diff --git a/qapi-event.json b/qapi-event.json
index fbdda48..6876327 100644
--- a/qapi-event.json
+++ b/qapi-event.json
@@ -304,3 +304,13 @@
 { 'event': 'QUORUM_REPORT_BAD',
   'data': { '*error': 'str', 'node-name': 'str',
             'sector-num': 'int', 'sector-count': 'int' } }
+
+##
+# @ACPI_DEVICE_OST
+#
+# Emitted when guest executes ACPI _OST method.
+#
+# @info: ACPIOSTInfo type as described in qapi-schema.json
+##
+{ 'event': 'ACPI_DEVICE_OST',
+     'data': { 'info': 'ACPIOSTInfo' } }
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-06-23 17:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-20  8:33 [Qemu-devel] [PATCH v3] qmp: add ACPI_DEVICE_OST event handling Igor Mammedov
2014-06-20 15:46 ` Eric Blake
2014-06-20 23:47   ` Wenchao Xia
2014-06-23  9:52     ` Markus Armbruster
2014-06-23 15:56     ` Eric Blake
2014-06-22  5:58 ` Michael S. Tsirkin
2014-06-23 15:59   ` Eric Blake
2014-06-23 17:17     ` Eric Blake

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).