[Top][All Lists]

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

Re: [Qemu-block] [PATCH 4/4] qapi: new qmp command nbd-server-add-bitmap

From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-block] [PATCH 4/4] qapi: new qmp command nbd-server-add-bitmap
Date: Thu, 22 Mar 2018 18:43:08 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

21.03.2018 20:33, Eric Blake wrote:
On 03/21/2018 07:19 AM, Vladimir Sementsov-Ogievskiy wrote:
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
  qapi/block.json | 27 +++++++++++++++++++++++++++
  blockdev-nbd.c  | 23 +++++++++++++++++++++++
  2 files changed, 50 insertions(+)

diff --git a/qapi/block.json b/qapi/block.json
index c694524002..4afbbcd7b7 100644
--- a/qapi/block.json
+++ b/qapi/block.json
@@ -269,6 +269,33 @@
    'data': {'name': 'str', '*mode': 'NbdServerRemoveMode'} }
+# @nbd-server-add-bitmap:
+# Export dirty bitmap through selected export. Bitmaps are searched for in +# device attached to the export and in all its backings. Exported bitmap
+# is locked until NBD export is removed.

Expose a dirty bitmap associated with the selected export.  The bitmap search starts at the device attached to the export, and includes all backing files.  The exported bitmap is then locked until the NBD export is removed.

+# @name: Export name.
+# @bitmap: Bitmap name to search.

s/search./search for./

+# @bitmap-export-name: How the bitmap will be seen by nbd clients
+#                      (default @bitmap)

Maybe mention that the client must use NBD_OPT_SET_META_CONTEXT with a query of "qemu-dirty-bitmap:NAME" (where NAME matches bitmap-export-name) to access the exposed bitmap.  (May need to be adjusted by my suggestion to use just the namespace "qemu:")


+# Returns: error on one of the following conditions:
+#           - the server is not running
+#           - export is not found
+#           - bitmap is not found
+#           - bitmap is disabled
+#           - bitmap is locked

Do we really need to list all the error conditions?  My worry is that a list this specific might go stale, compared to the obvious default that the command succeeds only if it was able to expose the bitmap and that the error message is specific enough for a human to figure out what to fix if it failed.

Hmm, I've just doing it similar with other commands in the file. Is there any requirements on this part of qapi documentation? I can write only "# Returns: nothing on success" line, is it appropriate? blockdev-mirror do so, but other commands tries to describe errors. Looks like we lack some specified format for return code description like we have for parameters..

+# Since: 2.13
+  { 'command': 'nbd-server-add-bitmap',
+    'data': {'name': 'str', 'bitmap': 'str', '*bitmap-export-name': 'str'} }

Best regards,

reply via email to

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