diff mbox series

[v2,1/3] qapi: rename BlockDirtyBitmapMergeSource to BlockDirtyBitmapOrStr

Message ID 20220314213226.362217-2-v.sementsov-og@mail.ru (mailing list archive)
State New, archived
Headers show
Series qapi: nbd-export: select bitmap by node/name pair | expand

Commit Message

Vladimir Sementsov-Ogievskiy March 14, 2022, 9:32 p.m. UTC
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

Rename the type to be reused. Old name is "what is it for". To be
natively reused for other needs, let's name it exactly "what is it".

Signed-off-by: Vladimir Sementsov-Ogievskiy <v.sementsov-og@ya.ru>
---
 block/monitor/bitmap-qmp-cmds.c        | 6 +++---
 include/block/block_int-global-state.h | 2 +-
 qapi/block-core.json                   | 6 +++---
 qemu-img.c                             | 8 ++++----
 4 files changed, 11 insertions(+), 11 deletions(-)

Comments

Eric Blake March 16, 2022, 9:18 p.m. UTC | #1
On Tue, Mar 15, 2022 at 12:32:24AM +0300, Vladimir Sementsov-Ogievskiy wrote:
> From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> 
> Rename the type to be reused. Old name is "what is it for". To be
> natively reused for other needs, let's name it exactly "what is it".
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <v.sementsov-og@ya.ru>
> ---
>  block/monitor/bitmap-qmp-cmds.c        | 6 +++---
>  include/block/block_int-global-state.h | 2 +-
>  qapi/block-core.json                   | 6 +++---
>  qemu-img.c                             | 8 ++++----
>  4 files changed, 11 insertions(+), 11 deletions(-)

The type name does not affect QAPI interface stability, so this is safe.

Reviewed-by: Eric Blake <eblake@redhat.com>
John Snow March 23, 2022, 1:31 a.m. UTC | #2
On Wed, Mar 16, 2022 at 5:18 PM Eric Blake <eblake@redhat.com> wrote:
>
> On Tue, Mar 15, 2022 at 12:32:24AM +0300, Vladimir Sementsov-Ogievskiy wrote:
> > From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> >
> > Rename the type to be reused. Old name is "what is it for". To be
> > natively reused for other needs, let's name it exactly "what is it".
> >
> > Signed-off-by: Vladimir Sementsov-Ogievskiy <v.sementsov-og@ya.ru>
> > ---
> >  block/monitor/bitmap-qmp-cmds.c        | 6 +++---
> >  include/block/block_int-global-state.h | 2 +-
> >  qapi/block-core.json                   | 6 +++---
> >  qemu-img.c                             | 8 ++++----
> >  4 files changed, 11 insertions(+), 11 deletions(-)
>
> The type name does not affect QAPI interface stability, so this is safe.
>
> Reviewed-by: Eric Blake <eblake@redhat.com>

Sounds right.

Acked-by: John Snow <jsnow@redhat.com>
diff mbox series

Patch

diff --git a/block/monitor/bitmap-qmp-cmds.c b/block/monitor/bitmap-qmp-cmds.c
index 8e35616c2e..2b677c4a2f 100644
--- a/block/monitor/bitmap-qmp-cmds.c
+++ b/block/monitor/bitmap-qmp-cmds.c
@@ -257,12 +257,12 @@  void qmp_block_dirty_bitmap_disable(const char *node, const char *name,
 }
 
 BdrvDirtyBitmap *block_dirty_bitmap_merge(const char *node, const char *target,
-                                          BlockDirtyBitmapMergeSourceList *bms,
+                                          BlockDirtyBitmapOrStrList *bms,
                                           HBitmap **backup, Error **errp)
 {
     BlockDriverState *bs;
     BdrvDirtyBitmap *dst, *src, *anon;
-    BlockDirtyBitmapMergeSourceList *lst;
+    BlockDirtyBitmapOrStrList *lst;
 
     GLOBAL_STATE_CODE();
 
@@ -317,7 +317,7 @@  BdrvDirtyBitmap *block_dirty_bitmap_merge(const char *node, const char *target,
 }
 
 void qmp_block_dirty_bitmap_merge(const char *node, const char *target,
-                                  BlockDirtyBitmapMergeSourceList *bitmaps,
+                                  BlockDirtyBitmapOrStrList *bitmaps,
                                   Error **errp)
 {
     block_dirty_bitmap_merge(node, target, bitmaps, NULL, errp);
diff --git a/include/block/block_int-global-state.h b/include/block/block_int-global-state.h
index 0f21b0570b..8b2e95f5ff 100644
--- a/include/block/block_int-global-state.h
+++ b/include/block/block_int-global-state.h
@@ -262,7 +262,7 @@  BdrvDirtyBitmap *block_dirty_bitmap_lookup(const char *node,
                                            BlockDriverState **pbs,
                                            Error **errp);
 BdrvDirtyBitmap *block_dirty_bitmap_merge(const char *node, const char *target,
-                                          BlockDirtyBitmapMergeSourceList *bms,
+                                          BlockDirtyBitmapOrStrList *bms,
                                           HBitmap **backup, Error **errp);
 BdrvDirtyBitmap *block_dirty_bitmap_remove(const char *node, const char *name,
                                            bool release,
diff --git a/qapi/block-core.json b/qapi/block-core.json
index e89f2dfb5b..c0eacd66db 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -2078,7 +2078,7 @@ 
             '*persistent': 'bool', '*disabled': 'bool' } }
 
 ##
-# @BlockDirtyBitmapMergeSource:
+# @BlockDirtyBitmapOrStr:
 #
 # @local: name of the bitmap, attached to the same node as target bitmap.
 #
@@ -2086,7 +2086,7 @@ 
 #
 # Since: 4.1
 ##
-{ 'alternate': 'BlockDirtyBitmapMergeSource',
+{ 'alternate': 'BlockDirtyBitmapOrStr',
   'data': { 'local': 'str',
             'external': 'BlockDirtyBitmap' } }
 
@@ -2105,7 +2105,7 @@ 
 ##
 { 'struct': 'BlockDirtyBitmapMerge',
   'data': { 'node': 'str', 'target': 'str',
-            'bitmaps': ['BlockDirtyBitmapMergeSource'] } }
+            'bitmaps': ['BlockDirtyBitmapOrStr'] } }
 
 ##
 # @block-dirty-bitmap-add:
diff --git a/qemu-img.c b/qemu-img.c
index 5dffb3e616..f853efe6fb 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1618,16 +1618,16 @@  static void do_dirty_bitmap_merge(const char *dst_node, const char *dst_name,
                                   const char *src_node, const char *src_name,
                                   Error **errp)
 {
-    BlockDirtyBitmapMergeSource *merge_src;
-    BlockDirtyBitmapMergeSourceList *list = NULL;
+    BlockDirtyBitmapOrStr *merge_src;
+    BlockDirtyBitmapOrStrList *list = NULL;
 
-    merge_src = g_new0(BlockDirtyBitmapMergeSource, 1);
+    merge_src = g_new0(BlockDirtyBitmapOrStr, 1);
     merge_src->type = QTYPE_QDICT;
     merge_src->u.external.node = g_strdup(src_node);
     merge_src->u.external.name = g_strdup(src_name);
     QAPI_LIST_PREPEND(list, merge_src);
     qmp_block_dirty_bitmap_merge(dst_node, dst_name, list, errp);
-    qapi_free_BlockDirtyBitmapMergeSourceList(list);
+    qapi_free_BlockDirtyBitmapOrStrList(list);
 }
 
 enum ImgConvertBlockStatus {