aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Cody <jcody@redhat.com>2018-04-04 11:40:45 -0400
committerJeff Cody <jcody@redhat.com>2018-04-04 12:05:13 -0400
commitbfb15b4becf2c9cf484bc3bf893a37c8f3c15cb3 (patch)
tree1168031ae53aa978f3862f0902e266ee70acdd9f
parentfd69ad866b62ca8ed4337ffee83b6d82a4e99282 (diff)
downloadqemu-bfb15b4becf2c9cf484bc3bf893a37c8f3c15cb3.zip
qemu-bfb15b4becf2c9cf484bc3bf893a37c8f3c15cb3.tar.gz
qemu-bfb15b4becf2c9cf484bc3bf893a37c8f3c15cb3.tar.bz2
block/rbd: remove processed options from qdict
Commit 4bfb274 added some QAPIfication of option parsing in qemu_rbd_open(). We need to remove all the options we processed, otherwise in bdrv_open_inherit() we will think the remaining options are invalid. (This needs to go in 2.12 to avoid a regression that prevents rbd from being opened.) Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--block/rbd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/block/rbd.c b/block/rbd.c
index 5b64849..c9359d0 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -623,6 +623,7 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags,
BlockdevOptionsRbd *opts = NULL;
Visitor *v;
QObject *crumpled = NULL;
+ const QDictEntry *e;
Error *local_err = NULL;
const char *filename;
char *keypairs, *secretid;
@@ -671,6 +672,12 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags,
goto out;
}
+ /* Remove the processed options from the QDict (the visitor processes
+ * _all_ options in the QDict) */
+ while ((e = qdict_first(options))) {
+ qdict_del(options, e->key);
+ }
+
r = qemu_rbd_connect(&s->cluster, &s->io_ctx, opts,
!(flags & BDRV_O_NOCACHE), keypairs, secretid, errp);
if (r < 0) {