From: Eric Blake <eblake@redhat.com>
To: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>,
qemu-devel@nongnu.org, imammedo@redhat.com, pbonzini@redhat.com
Cc: guz.fnst@cn.fujitsu.com, izumi.taku@jp.fujitsu.com,
tangchen@cn.fujitsu.com
Subject: Re: [Qemu-devel] [PATCH v5 7/7] qmp-event: add event notification for memory hot unplug error
Date: Fri, 27 Mar 2015 08:53:55 -0600 [thread overview]
Message-ID: <55156F03.8090700@redhat.com> (raw)
In-Reply-To: <b5ed021db356ccbd9fad321be34616be3f67a225.1427425363.git.zhugh.fnst@cn.fujitsu.com>
[-- Attachment #1: Type: text/plain, Size: 3140 bytes --]
On 03/27/2015 03:20 AM, Zhu Guihua wrote:
> When memory hot unplug fails, this patch adds support to send
> QMP event to notify mgmt about this failure.
>
> Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
> ---
> docs/qmp/qmp-events.txt | 17 +++++++++++++++++
> hw/acpi/memory_hotplug.c | 8 +++++++-
> monitor.c | 1 +
> qapi/event.json | 14 ++++++++++++++
> 4 files changed, 39 insertions(+), 1 deletion(-)
>
> diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt
> index d759d19..7a05705 100644
> --- a/docs/qmp/qmp-events.txt
> +++ b/docs/qmp/qmp-events.txt
> @@ -226,6 +226,23 @@ Example:
> { "event": "GUEST_PANICKED",
> "data": { "action": "pause" } }
>
> +MEM_HOT_UNPLUG_ERROR
> +--------------------
> +Emitted when memory hot unplug occurs error.
s/occurs error/error occurs/
> +
> +Data:
> +
> +- "device": device name (json-string)
> +- "msg": Informative message (e.g., reason for the error) (json-string)
> +
> +Example:
> +
> +{ "event": "MEM_HOT_UNPLUG_ERROR"
> + "data": { "device": "dimm1",
> + "msg": "acpi: device unplug for not supported device"
s/not supported/unsupported/
> + },
> + "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
> +
> NIC_RX_FILTER_CHANGED
> ---------------------
>
> diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
> index 2a1b866..f1cef71 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,12 @@ 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) {
> + qapi_event_send_mem_unplug_error(dev->id,
> + error_get_pretty(local_err),
> + &error_abort);
> + }
> }
Does this leak local_err?
> +++ b/qapi/event.json
> @@ -330,3 +330,17 @@
> ##
> { 'event': 'VSERPORT_CHANGE',
> 'data': { 'id': 'str', 'open': 'bool' } }
> +
> +##
> +# @MEM_UNPLUG_ERROR
> +#
> +# Emitted when memory hot unplug occurs error.
s/occurs error/error occurs/
> +#
> +# @device: device name
> +#
> +# @msg: Informative message
> +#
> +# Since: 2.3
You're awfully late for 2.3; this may need to be 2.4.
> +##
> +{ 'event': 'MEM_UNPLUG_ERROR',
> + 'data': { 'device': 'str', 'msg': 'str' } }
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2015-03-27 14:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-27 9:20 [Qemu-devel] [PATCH v5 0/7] QEMU memory hot unplug support Zhu Guihua
2015-03-27 9:20 ` [Qemu-devel] [PATCH v5 1/7] docs: update documentation for memory hot unplug Zhu Guihua
2015-03-30 15:47 ` Igor Mammedov
2015-03-27 9:20 ` [Qemu-devel] [PATCH v5 2/7] acpi, mem-hotplug: add acpi_memory_slot_status() to get MemStatus Zhu Guihua
2015-03-27 9:20 ` [Qemu-devel] [PATCH v5 3/7] acpi, mem-hotplug: add unplug request cb for memory device Zhu Guihua
2015-04-01 8:23 ` Igor Mammedov
2015-03-27 9:20 ` [Qemu-devel] [PATCH v5 4/7] acpi, mem-hotplug: add unplug " Zhu Guihua
2015-03-27 9:20 ` [Qemu-devel] [PATCH v5 5/7] acpi: extend aml_field() to support UpdateRule Zhu Guihua
2015-04-01 8:39 ` Igor Mammedov
2015-03-27 9:20 ` [Qemu-devel] [PATCH v5 6/7] acpi: add hardware implementation for memory hot unplug Zhu Guihua
2015-03-30 9:09 ` Igor Mammedov
2015-03-27 9:20 ` [Qemu-devel] [PATCH v5 7/7] qmp-event: add event notification for memory hot unplug error Zhu Guihua
2015-03-27 14:53 ` Eric Blake [this message]
2015-03-30 3:07 ` Zhu Guihua
2015-03-30 2:53 ` [Qemu-devel] [PATCH v5 0/7] QEMU memory hot unplug support Zhu Guihua
2015-03-30 7:49 ` Paolo Bonzini
2015-04-01 8:42 ` Igor Mammedov
2015-04-01 9:43 ` Zhu Guihua
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55156F03.8090700@redhat.com \
--to=eblake@redhat.com \
--cc=guz.fnst@cn.fujitsu.com \
--cc=imammedo@redhat.com \
--cc=izumi.taku@jp.fujitsu.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=tangchen@cn.fujitsu.com \
--cc=zhugh.fnst@cn.fujitsu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).