[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3] qmp: add ACPI_DEVICE_OST event handling
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH v3] qmp: add ACPI_DEVICE_OST event handling |
Date: |
Fri, 20 Jun 2014 10:33:26 +0200 |
emits event when ACPI OSPM evaluates _OST method
of ACPI device.
Signed-off-by: Igor Mammedov <address@hidden>
---
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
- [Qemu-devel] [PATCH v3] qmp: add ACPI_DEVICE_OST event handling,
Igor Mammedov <=