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