qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Alberto Garcia <berto@igalia.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] block: allow BLOCK_IMAGE_CORRUPTED to have a node name
Date: Thu, 19 Mar 2015 15:42:35 -0400	[thread overview]
Message-ID: <550B26AB.4050806@redhat.com> (raw)
In-Reply-To: <9d3f0e0ee6fcfc6300e165f79b46a4af0ffdc37d.1426779661.git.berto@igalia.com>

On 2015-03-19 at 11:43, Alberto Garcia wrote:
> Since this event can occur in nodes that don't have a device name
> associated, use the node name as fallback in those cases.
>
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
>   block/qcow2.c           | 5 +++--
>   docs/qmp/qmp-events.txt | 2 +-
>   qapi/block-core.json    | 2 +-
>   3 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/block/qcow2.c b/block/qcow2.c
> index 168006b..d808c70 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c
> @@ -2832,8 +2832,9 @@ void qcow2_signal_corruption(BlockDriverState *bs, bool fatal, int64_t offset,
>                   "corruption events will be suppressed\n", message);
>       }
>   
> -    qapi_event_send_block_image_corrupted(bdrv_get_device_name(bs), message,
> -                                          offset >= 0, offset, size >= 0, size,
> +    qapi_event_send_block_image_corrupted(bdrv_get_device_or_node_name(bs),
> +                                          message, offset >= 0, offset,
> +                                          size >= 0, size,
>                                             fatal, &error_abort);
>       g_free(message);
>   
> diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt
> index d759d19..75f3e68 100644
> --- a/docs/qmp/qmp-events.txt
> +++ b/docs/qmp/qmp-events.txt
> @@ -35,7 +35,7 @@ Emitted when a disk image is being marked corrupt.
>   
>   Data:
>   
> -- "device": Device name (json-string)
> +- "device": Device name, or node name if not present (json-string)
>   - "msg":    Informative message (e.g., reason for the corruption) (json-string)
>   - "offset": If the corruption resulted from an image access, this is the access
>               offset into the image (json-int)
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 42c8850..3b51c68 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -1751,7 +1751,7 @@
>   #
>   # Emitted when a corruption has been detected in a disk image
>   #
> -# @device: device name
> +# @device: device name, or node name if not present
>   #
>   # @msg: informative message for human consumption, such as the kind of
>   #       corruption being detected. It should not be parsed by machine as it is

Basically the same as my reply to patch 2, but here it's a formal 
question as well: Normally, if a field in QMP is designed @device, it 
contains a device name. We do have combined device/node name fields, 
though (as of John's incremental backup series, at least), but those are 
named @node (which I proposed for patch 2, too).

But renaming the field here will lead to breaking backwards 
compatibility. I think just adding a @node-name field and keeping 
@device as it is should be good enough here.

Max

  reply	other threads:[~2015-03-19 19:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 15:43 [Qemu-devel] [PATCH 0/3] Add bdrv_get_device_or_node_name() Alberto Garcia
2015-03-19 15:43 ` [Qemu-devel] [PATCH 1/3] block: add bdrv_get_device_or_node_name() Alberto Garcia
2015-03-19 19:26   ` Max Reitz
2015-03-20  7:40   ` Markus Armbruster
2015-03-20  8:03     ` Alberto Garcia
2015-03-20  8:47       ` Markus Armbruster
2015-03-19 15:43 ` [Qemu-devel] [PATCH 2/3] block: use bdrv_get_device_or_node_name() in error messages Alberto Garcia
2015-03-19 19:37   ` Max Reitz
2015-03-20  7:52   ` Markus Armbruster
2015-03-19 15:43 ` [Qemu-devel] [PATCH 3/3] block: allow BLOCK_IMAGE_CORRUPTED to have a node name Alberto Garcia
2015-03-19 19:42   ` Max Reitz [this message]
2015-03-19 21:42     ` Alberto Garcia
2015-03-19 21:52       ` Max Reitz
2015-03-19 22:04         ` Alberto Garcia
2015-03-19 22:15       ` Eric Blake
2015-03-19 22:38         ` Alberto Garcia
2015-03-19 23:14           ` Eric Blake
2015-03-20  9:23             ` Alberto Garcia
2015-03-19 19:37 ` [Qemu-devel] [PATCH 0/3] Add bdrv_get_device_or_node_name() Max Reitz
2015-03-19 21:49   ` Alberto Garcia

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=550B26AB.4050806@redhat.com \
    --to=mreitz@redhat.com \
    --cc=berto@igalia.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).