aboutsummaryrefslogtreecommitdiff
path: root/hw/acpi/memory_hotplug.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2014-06-23 15:26:57 +0200
committerLuiz Capitulino <lcapitulino@redhat.com>2014-06-23 11:12:28 -0400
commit5f41fbba903fc4e55b94c54cd97ea2d904371351 (patch)
tree686961cab813f28a2abd2a1cf017080616ae97e0 /hw/acpi/memory_hotplug.c
parent7cfadb6b5291765d360137ac5cab78729bde0272 (diff)
qmp: convert ACPI_DEVICE_OST event
... using new QAPI event infrastructure Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'hw/acpi/memory_hotplug.c')
-rw-r--r--hw/acpi/memory_hotplug.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index de4ddc204f..38ca415f64 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -3,10 +3,7 @@
#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"
+#include "qapi-event.h"
static ACPIOSTInfo *acpi_memory_device_status(int slot, MemStatus *mdev)
{
@@ -39,29 +36,6 @@ 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)
{
@@ -115,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;
@@ -147,7 +122,10 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data,
mdev->ost_status = data;
trace_mhp_acpi_write_ost_status(mem_st->selector, mdev->ost_status);
/* TODO: implement memory removal on guest signal */
- acpi_memory_ost_mon_event(mem_st);
+
+ 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];