diff options
author | Eric Blake <eblake@redhat.com> | 2020-10-27 00:05:49 -0500 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2020-10-30 15:10:15 -0500 |
commit | cbad81cef8cc7b220f04600997ea29d7302bae00 (patch) | |
tree | b99f92ee23a0a2eb40efdad1a493e373c9cdcb60 /qemu-nbd.c | |
parent | 8675cbd68be7da35a61e391fbb5b95ac67bc7d72 (diff) | |
download | qemu-cbad81cef8cc7b220f04600997ea29d7302bae00.zip qemu-cbad81cef8cc7b220f04600997ea29d7302bae00.tar.gz qemu-cbad81cef8cc7b220f04600997ea29d7302bae00.tar.bz2 |
nbd: Update qapi to support exporting multiple bitmaps
Since 'block-export-add' is new to 5.2, we can still tweak the
interface; there, allowing 'bitmaps':['str'] is nicer than
'bitmap':'str'. This wires up the qapi and qemu-nbd changes to permit
passing multiple bitmaps as distinct metadata contexts that the NBD
client may request, but the actual support for more than one will
require a further patch to the server.
Note that there are no changes made to the existing deprecated
'nbd-server-add' command; this required splitting the QAPI type
BlockExportOptionsNbd, which fortunately does not affect QMP
introspection.
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20201027050556.269064-5-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Diffstat (limited to 'qemu-nbd.c')
-rw-r--r-- | qemu-nbd.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -574,7 +574,7 @@ int main(int argc, char **argv) QDict *options = NULL; const char *export_name = NULL; /* defaults to "" later for server mode */ const char *export_description = NULL; - const char *bitmap = NULL; + strList *bitmaps = NULL; const char *tlscredsid = NULL; bool imageOpts = false; bool writethrough = true; @@ -690,7 +690,7 @@ int main(int argc, char **argv) flags &= ~BDRV_O_RDWR; break; case 'B': - bitmap = optarg; + QAPI_LIST_PREPEND(bitmaps, g_strdup(optarg)); break; case 'k': sockpath = optarg; @@ -786,7 +786,7 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } if (export_name || export_description || dev_offset || - device || disconnect || fmt || sn_id_or_name || bitmap || + device || disconnect || fmt || sn_id_or_name || bitmaps || seen_aio || seen_discard || seen_cache) { error_report("List mode is incompatible with per-device settings"); exit(EXIT_FAILURE); @@ -1067,12 +1067,12 @@ int main(int argc, char **argv) .has_writable = true, .writable = !readonly, .u.nbd = { - .has_name = true, - .name = g_strdup(export_name), - .has_description = !!export_description, - .description = g_strdup(export_description), - .has_bitmap = !!bitmap, - .bitmap = g_strdup(bitmap), + .has_name = true, + .name = g_strdup(export_name), + .has_description = !!export_description, + .description = g_strdup(export_description), + .has_bitmaps = !!bitmaps, + .bitmaps = bitmaps, }, }; blk_exp_add(export_opts, &error_fatal); |