[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/3] block: allow BLOCK_IMAGE_CORRUPTED to have

From: Max Reitz
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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

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 <address@hidden>
  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);
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) 
  - "offset": If the corruption resulted from an image access, this is the 
              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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]