diff options
author | Zhu Guihua <zhugh.fnst@cn.fujitsu.com> | 2015-04-27 16:47:22 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-04-27 21:09:07 +0200 |
commit | bc09e06113e79e5d70cf2b37015a26f2102cc03e (patch) | |
tree | a4799b52359aa5e54b5ddcfd3881cec0b4ba40e5 /hw/acpi/memory_hotplug.c | |
parent | c06b2ffb02bfcc642c67300d2c4dffd5aa54932b (diff) |
qmp-event: add event notification for memory hot unplug error
When memory hot unplug fails, this patch adds support to send
QMP event to notify mgmt about this failure.
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/acpi/memory_hotplug.c')
-rw-r--r-- | hw/acpi/memory_hotplug.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index 35bbfeb1d8..34cef1e5c3 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug.c @@ -94,6 +94,7 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data, ACPIOSTInfo *info; DeviceState *dev = NULL; HotplugHandler *hotplug_ctrl = NULL; + Error *local_err = NULL; if (!mem_st->dev_count) { return; @@ -148,7 +149,14 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data, dev = DEVICE(mdev->dimm); hotplug_ctrl = qdev_get_hotplug_handler(dev); /* call pc-dimm unplug cb */ - hotplug_handler_unplug(hotplug_ctrl, dev, NULL); + hotplug_handler_unplug(hotplug_ctrl, dev, &local_err); + if (local_err) { + trace_mhp_acpi_pc_dimm_delete_failed(mem_st->selector); + qapi_event_send_mem_unplug_error(dev->id, + error_get_pretty(local_err), + &error_abort); + break; + } trace_mhp_acpi_pc_dimm_deleted(mem_st->selector); } break; |