Blame SOURCES/kvm-block-remove-x-prefix-from-experimental-bitmap-APIs.patch

383d26
From 73ad88009003572e654deca01a7c64655677bf39 Mon Sep 17 00:00:00 2001
383d26
From: John Snow <jsnow@redhat.com>
383d26
Date: Wed, 20 Mar 2019 16:16:17 +0100
383d26
Subject: [PATCH 019/163] block: remove 'x' prefix from experimental bitmap
383d26
 APIs
383d26
383d26
RH-Author: John Snow <jsnow@redhat.com>
383d26
Message-id: <20190320161631.14841-6-jsnow@redhat.com>
383d26
Patchwork-id: 84949
383d26
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 05/19] block: remove 'x' prefix from experimental bitmap APIs
383d26
Bugzilla: 1668956
383d26
RH-Acked-by: Max Reitz <mreitz@redhat.com>
383d26
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
383d26
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
383d26
383d26
The 'x' prefix was added because I was uncertain of the direction we'd
383d26
take for the libvirt API. With the general approach solidified, I feel
383d26
comfortable committing to this API for 4.0.
383d26
383d26
Signed-off-by: John Snow <jsnow@redhat.com>
383d26
Reviewed-by: Eric Blake <eblake@redhat.com>
383d26
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
383d26
Message-Id: <20181221093529.23855-5-jsnow@redhat.com>
383d26
Signed-off-by: Eric Blake <eblake@redhat.com>
383d26
(cherry picked from commit 0e2b7f09837f1e2828d428af1e4ebb61e3b3ea5f)
383d26
Signed-off-by: John Snow <jsnow@redhat.com>
383d26
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
383d26
---
383d26
 blockdev.c             | 22 +++++++++++-----------
383d26
 qapi/block-core.json   | 34 +++++++++++++++++-----------------
383d26
 qapi/transaction.json  | 12 ++++++------
383d26
 tests/qemu-iotests/223 |  4 ++--
383d26
 4 files changed, 36 insertions(+), 36 deletions(-)
383d26
383d26
diff --git a/blockdev.c b/blockdev.c
383d26
index 3755936..47db9bb 100644
383d26
--- a/blockdev.c
383d26
+++ b/blockdev.c
383d26
@@ -2116,7 +2116,7 @@ static void block_dirty_bitmap_add_prepare(BlkActionState *common,
383d26
                                action->has_granularity, action->granularity,
383d26
                                action->has_persistent, action->persistent,
383d26
                                action->has_autoload, action->autoload,
383d26
-                               action->has_x_disabled, action->x_disabled,
383d26
+                               action->has_disabled, action->disabled,
383d26
                                &local_err);
383d26
 
383d26
     if (!local_err) {
383d26
@@ -2201,7 +2201,7 @@ static void block_dirty_bitmap_enable_prepare(BlkActionState *common,
383d26
         return;
383d26
     }
383d26
 
383d26
-    action = common->action->u.x_block_dirty_bitmap_enable.data;
383d26
+    action = common->action->u.block_dirty_bitmap_enable.data;
383d26
     state->bitmap = block_dirty_bitmap_lookup(action->node,
383d26
                                               action->name,
383d26
                                               NULL,
383d26
@@ -2242,7 +2242,7 @@ static void block_dirty_bitmap_disable_prepare(BlkActionState *common,
383d26
         return;
383d26
     }
383d26
 
383d26
-    action = common->action->u.x_block_dirty_bitmap_disable.data;
383d26
+    action = common->action->u.block_dirty_bitmap_disable.data;
383d26
     state->bitmap = block_dirty_bitmap_lookup(action->node,
383d26
                                               action->name,
383d26
                                               NULL,
383d26
@@ -2289,7 +2289,7 @@ static void block_dirty_bitmap_merge_prepare(BlkActionState *common,
383d26
         return;
383d26
     }
383d26
 
383d26
-    action = common->action->u.x_block_dirty_bitmap_merge.data;
383d26
+    action = common->action->u.block_dirty_bitmap_merge.data;
383d26
 
383d26
     state->bitmap = do_block_dirty_bitmap_merge(action->node, action->target,
383d26
                                                 action->bitmaps, &state->backup,
383d26
@@ -2357,17 +2357,17 @@ static const BlkActionOps actions[] = {
383d26
         .commit = block_dirty_bitmap_free_backup,
383d26
         .abort = block_dirty_bitmap_restore,
383d26
     },
383d26
-    [TRANSACTION_ACTION_KIND_X_BLOCK_DIRTY_BITMAP_ENABLE] = {
383d26
+    [TRANSACTION_ACTION_KIND_BLOCK_DIRTY_BITMAP_ENABLE] = {
383d26
         .instance_size = sizeof(BlockDirtyBitmapState),
383d26
         .prepare = block_dirty_bitmap_enable_prepare,
383d26
         .abort = block_dirty_bitmap_enable_abort,
383d26
     },
383d26
-    [TRANSACTION_ACTION_KIND_X_BLOCK_DIRTY_BITMAP_DISABLE] = {
383d26
+    [TRANSACTION_ACTION_KIND_BLOCK_DIRTY_BITMAP_DISABLE] = {
383d26
         .instance_size = sizeof(BlockDirtyBitmapState),
383d26
         .prepare = block_dirty_bitmap_disable_prepare,
383d26
         .abort = block_dirty_bitmap_disable_abort,
383d26
     },
383d26
-    [TRANSACTION_ACTION_KIND_X_BLOCK_DIRTY_BITMAP_MERGE] = {
383d26
+    [TRANSACTION_ACTION_KIND_BLOCK_DIRTY_BITMAP_MERGE] = {
383d26
         .instance_size = sizeof(BlockDirtyBitmapState),
383d26
         .prepare = block_dirty_bitmap_merge_prepare,
383d26
         .commit = block_dirty_bitmap_free_backup,
383d26
@@ -3083,7 +3083,7 @@ void qmp_block_dirty_bitmap_clear(const char *node, const char *name,
383d26
     bdrv_clear_dirty_bitmap(bitmap, NULL);
383d26
 }
383d26
 
383d26
-void qmp_x_block_dirty_bitmap_enable(const char *node, const char *name,
383d26
+void qmp_block_dirty_bitmap_enable(const char *node, const char *name,
383d26
                                    Error **errp)
383d26
 {
383d26
     BlockDriverState *bs;
383d26
@@ -3104,7 +3104,7 @@ void qmp_x_block_dirty_bitmap_enable(const char *node, const char *name,
383d26
     bdrv_enable_dirty_bitmap(bitmap);
383d26
 }
383d26
 
383d26
-void qmp_x_block_dirty_bitmap_disable(const char *node, const char *name,
383d26
+void qmp_block_dirty_bitmap_disable(const char *node, const char *name,
383d26
                                     Error **errp)
383d26
 {
383d26
     BlockDriverState *bs;
383d26
@@ -3171,8 +3171,8 @@ static BdrvDirtyBitmap *do_block_dirty_bitmap_merge(const char *node,
383d26
     return dst;
383d26
 }
383d26
 
383d26
-void qmp_x_block_dirty_bitmap_merge(const char *node, const char *target,
383d26
-                                    strList *bitmaps, Error **errp)
383d26
+void qmp_block_dirty_bitmap_merge(const char *node, const char *target,
383d26
+                                  strList *bitmaps, Error **errp)
383d26
 {
383d26
     do_block_dirty_bitmap_merge(node, target, bitmaps, NULL, errp);
383d26
 }
383d26
diff --git a/qapi/block-core.json b/qapi/block-core.json
383d26
index 7e11392..176c04e 100644
383d26
--- a/qapi/block-core.json
383d26
+++ b/qapi/block-core.json
383d26
@@ -1786,15 +1786,15 @@
383d26
 #            Currently, all dirty tracking bitmaps are loaded from Qcow2 on
383d26
 #            open.
383d26
 #
383d26
-# @x-disabled: the bitmap is created in the disabled state, which means that
383d26
-#              it will not track drive changes. The bitmap may be enabled with
383d26
-#              x-block-dirty-bitmap-enable. Default is false. (Since: 3.0)
383d26
+# @disabled: the bitmap is created in the disabled state, which means that
383d26
+#            it will not track drive changes. The bitmap may be enabled with
383d26
+#            block-dirty-bitmap-enable. Default is false. (Since: 4.0)
383d26
 #
383d26
 # Since: 2.4
383d26
 ##
383d26
 { 'struct': 'BlockDirtyBitmapAdd',
383d26
   'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
383d26
-            '*persistent': 'bool', '*autoload': 'bool', '*x-disabled': 'bool' } }
383d26
+            '*persistent': 'bool', '*autoload': 'bool', '*disabled': 'bool' } }
383d26
 
383d26
 ##
383d26
 # @BlockDirtyBitmapMerge:
383d26
@@ -1805,7 +1805,7 @@
383d26
 #
383d26
 # @bitmaps: name(s) of the source dirty bitmap(s)
383d26
 #
383d26
-# Since: 3.0
383d26
+# Since: 4.0
383d26
 ##
383d26
 { 'struct': 'BlockDirtyBitmapMerge',
383d26
   'data': { 'node': 'str', 'target': 'str', 'bitmaps': ['str'] } }
383d26
@@ -1879,7 +1879,7 @@
383d26
   'data': 'BlockDirtyBitmap' }
383d26
 
383d26
 ##
383d26
-# @x-block-dirty-bitmap-enable:
383d26
+# @block-dirty-bitmap-enable:
383d26
 #
383d26
 # Enables a dirty bitmap so that it will begin tracking disk changes.
383d26
 #
383d26
@@ -1887,20 +1887,20 @@
383d26
 #          If @node is not a valid block device, DeviceNotFound
383d26
 #          If @name is not found, GenericError with an explanation
383d26
 #
383d26
-# Since: 3.0
383d26
+# Since: 4.0
383d26
 #
383d26
 # Example:
383d26
 #
383d26
-# -> { "execute": "x-block-dirty-bitmap-enable",
383d26
+# -> { "execute": "block-dirty-bitmap-enable",
383d26
 #      "arguments": { "node": "drive0", "name": "bitmap0" } }
383d26
 # <- { "return": {} }
383d26
 #
383d26
 ##
383d26
-  { 'command': 'x-block-dirty-bitmap-enable',
383d26
+  { 'command': 'block-dirty-bitmap-enable',
383d26
     'data': 'BlockDirtyBitmap' }
383d26
 
383d26
 ##
383d26
-# @x-block-dirty-bitmap-disable:
383d26
+# @block-dirty-bitmap-disable:
383d26
 #
383d26
 # Disables a dirty bitmap so that it will stop tracking disk changes.
383d26
 #
383d26
@@ -1908,20 +1908,20 @@
383d26
 #          If @node is not a valid block device, DeviceNotFound
383d26
 #          If @name is not found, GenericError with an explanation
383d26
 #
383d26
-# Since: 3.0
383d26
+# Since: 4.0
383d26
 #
383d26
 # Example:
383d26
 #
383d26
-# -> { "execute": "x-block-dirty-bitmap-disable",
383d26
+# -> { "execute": "block-dirty-bitmap-disable",
383d26
 #      "arguments": { "node": "drive0", "name": "bitmap0" } }
383d26
 # <- { "return": {} }
383d26
 #
383d26
 ##
383d26
-    { 'command': 'x-block-dirty-bitmap-disable',
383d26
+    { 'command': 'block-dirty-bitmap-disable',
383d26
       'data': 'BlockDirtyBitmap' }
383d26
 
383d26
 ##
383d26
-# @x-block-dirty-bitmap-merge:
383d26
+# @block-dirty-bitmap-merge:
383d26
 #
383d26
 # Merge dirty bitmaps listed in @bitmaps to the @target dirty bitmap.
383d26
 # The @bitmaps dirty bitmaps are unchanged.
383d26
@@ -1933,17 +1933,17 @@
383d26
 #          If any of the bitmaps have different sizes or granularities,
383d26
 #              GenericError
383d26
 #
383d26
-# Since: 3.0
383d26
+# Since: 4.0
383d26
 #
383d26
 # Example:
383d26
 #
383d26
-# -> { "execute": "x-block-dirty-bitmap-merge",
383d26
+# -> { "execute": "block-dirty-bitmap-merge",
383d26
 #      "arguments": { "node": "drive0", "target": "bitmap0",
383d26
 #                     "bitmaps": ["bitmap1"] } }
383d26
 # <- { "return": {} }
383d26
 #
383d26
 ##
383d26
-      { 'command': 'x-block-dirty-bitmap-merge',
383d26
+      { 'command': 'block-dirty-bitmap-merge',
383d26
         'data': 'BlockDirtyBitmapMerge' }
383d26
 
383d26
 ##
383d26
diff --git a/qapi/transaction.json b/qapi/transaction.json
383d26
index 5875cdb..95edb78 100644
383d26
--- a/qapi/transaction.json
383d26
+++ b/qapi/transaction.json
383d26
@@ -46,9 +46,9 @@
383d26
 # - @abort: since 1.6
383d26
 # - @block-dirty-bitmap-add: since 2.5
383d26
 # - @block-dirty-bitmap-clear: since 2.5
383d26
-# - @x-block-dirty-bitmap-enable: since 3.0
383d26
-# - @x-block-dirty-bitmap-disable: since 3.0
383d26
-# - @x-block-dirty-bitmap-merge: since 3.1
383d26
+# - @block-dirty-bitmap-enable: since 4.0
383d26
+# - @block-dirty-bitmap-disable: since 4.0
383d26
+# - @block-dirty-bitmap-merge: since 4.0
383d26
 # - @blockdev-backup: since 2.3
383d26
 # - @blockdev-snapshot: since 2.5
383d26
 # - @blockdev-snapshot-internal-sync: since 1.7
383d26
@@ -62,9 +62,9 @@
383d26
        'abort': 'Abort',
383d26
        'block-dirty-bitmap-add': 'BlockDirtyBitmapAdd',
383d26
        'block-dirty-bitmap-clear': 'BlockDirtyBitmap',
383d26
-       'x-block-dirty-bitmap-enable': 'BlockDirtyBitmap',
383d26
-       'x-block-dirty-bitmap-disable': 'BlockDirtyBitmap',
383d26
-       'x-block-dirty-bitmap-merge': 'BlockDirtyBitmapMerge',
383d26
+       'block-dirty-bitmap-enable': 'BlockDirtyBitmap',
383d26
+       'block-dirty-bitmap-disable': 'BlockDirtyBitmap',
383d26
+       'block-dirty-bitmap-merge': 'BlockDirtyBitmapMerge',
383d26
        'blockdev-backup': 'BlockdevBackup',
383d26
        'blockdev-snapshot': 'BlockdevSnapshot',
383d26
        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal',
383d26
diff --git a/tests/qemu-iotests/223 b/tests/qemu-iotests/223
383d26
index a462f41..e59411e 100755
383d26
--- a/tests/qemu-iotests/223
383d26
+++ b/tests/qemu-iotests/223
383d26
@@ -111,9 +111,9 @@ _send_qemu_cmd $QEMU_HANDLE '{"execute":"qmp_capabilities"}' "return"
383d26
 _send_qemu_cmd $QEMU_HANDLE '{"execute":"blockdev-add",
383d26
   "arguments":{"driver":"qcow2", "node-name":"n",
383d26
     "file":{"driver":"file", "filename":"'"$TEST_IMG"'"}}}' "return"
383d26
-_send_qemu_cmd $QEMU_HANDLE '{"execute":"x-block-dirty-bitmap-disable",
383d26
+_send_qemu_cmd $QEMU_HANDLE '{"execute":"block-dirty-bitmap-disable",
383d26
   "arguments":{"node":"n", "name":"b"}}' "return"
383d26
-_send_qemu_cmd $QEMU_HANDLE '{"execute":"x-block-dirty-bitmap-disable",
383d26
+_send_qemu_cmd $QEMU_HANDLE '{"execute":"block-dirty-bitmap-disable",
383d26
   "arguments":{"node":"n", "name":"b2"}}' "return"
383d26
 _send_qemu_cmd $QEMU_HANDLE '{"execute":"nbd-server-start",
383d26
   "arguments":{"addr":{"type":"unix",
383d26
-- 
383d26
1.8.3.1
383d26