From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxuGR-0004B1-7u for qemu-devel@nongnu.org; Fri, 20 Jun 2014 04:33:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxuGL-0000mg-2M for qemu-devel@nongnu.org; Fri, 20 Jun 2014 04:33:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxuGK-0000lN-Pk for qemu-devel@nongnu.org; Fri, 20 Jun 2014 04:33:33 -0400 From: Igor Mammedov Date: Fri, 20 Jun 2014 10:33:26 +0200 Message-Id: <1403253206-11133-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH v3] qmp: add ACPI_DEVICE_OST event handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: wenchaoqemu@gmail.com, mst@redhat.com emits event when ACPI OSPM evaluates _OST method of ACPI device. Signed-off-by: Igor Mammedov --- 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