[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL for-2.9 05/10] rbd: Don't accept -drive driver=rbd, k
From: |
Jeff Cody |
Subject: |
[Qemu-block] [PULL for-2.9 05/10] rbd: Don't accept -drive driver=rbd, keyvalue-pairs=... |
Date: |
Tue, 28 Mar 2017 10:05:50 -0400 |
From: Markus Armbruster <address@hidden>
The way we communicate extra key-value pairs from
qemu_rbd_parse_filename() to qemu_rbd_open() exposes option parameter
"keyvalue-pairs" on the command line. It's not wanted there. Hack:
rename the parameter to "=keyvalue-pairs" to make it inaccessible.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>
Message-id: address@hidden
Signed-off-by: Jeff Cody <address@hidden>
---
block/rbd.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/block/rbd.c b/block/rbd.c
index 182a5a3..2632533 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -215,7 +215,7 @@ static void qemu_rbd_parse_filename(const char *filename,
QDict *options,
}
if (keypairs[0]) {
- qdict_put(options, "keyvalue-pairs", qstring_from_str(keypairs));
+ qdict_put(options, "=keyvalue-pairs", qstring_from_str(keypairs));
}
@@ -330,7 +330,11 @@ static QemuOptsList runtime_opts = {
.help = "Rados id name",
},
{
- .name = "keyvalue-pairs",
+ /*
+ * HACK: name starts with '=' so that qemu_opts_parse()
+ * can't set it
+ */
+ .name = "=keyvalue-pairs",
.type = QEMU_OPT_STRING,
.help = "Legacy rados key/value option parameters",
},
@@ -405,7 +409,7 @@ static int qemu_rbd_create(const char *filename, QemuOpts
*opts, Error **errp)
conf = qemu_opt_get(rbd_opts, "conf");
clientname = qemu_opt_get(rbd_opts, "user");
name = qemu_opt_get(rbd_opts, "image");
- keypairs = qemu_opt_get(rbd_opts, "keyvalue-pairs");
+ keypairs = qemu_opt_get(rbd_opts, "=keyvalue-pairs");
ret = rados_create(&cluster, clientname);
if (ret < 0) {
@@ -638,7 +642,7 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict
*options, int flags,
snap = qemu_opt_get(opts, "snapshot");
clientname = qemu_opt_get(opts, "user");
name = qemu_opt_get(opts, "image");
- keypairs = qemu_opt_get(opts, "keyvalue-pairs");
+ keypairs = qemu_opt_get(opts, "=keyvalue-pairs");
if (!pool || !name) {
error_setg(errp, "Parameters 'pool' and 'image' are required");
--
2.9.3
- [Qemu-block] [PULL for-2.9 00/10] Block patches for -rc2, Jeff Cody, 2017/03/28
- [Qemu-block] [PULL for-2.9 01/10] rbd: Reject -blockdev server.*.{numeric, to, ipv4, ipv6}, Jeff Cody, 2017/03/28
- [Qemu-block] [PULL for-2.9 03/10] rbd: Don't limit length of parameter values, Jeff Cody, 2017/03/28
- [Qemu-block] [PULL for-2.9 04/10] rbd: Clean up after the previous commit, Jeff Cody, 2017/03/28
- [Qemu-block] [PULL for-2.9 05/10] rbd: Don't accept -drive driver=rbd, keyvalue-pairs=...,
Jeff Cody <=
- [Qemu-block] [PULL for-2.9 07/10] rbd: Clean up qemu_rbd_create()'s detour through QemuOpts, Jeff Cody, 2017/03/28
- [Qemu-block] [PULL for-2.9 02/10] rbd: Fix to cleanly reject -drive without pool or image, Jeff Cody, 2017/03/28
- [Qemu-block] [PULL for-2.9 06/10] rbd: Clean up runtime_opts, fix -drive to reject filename, Jeff Cody, 2017/03/28
- [Qemu-block] [PULL for-2.9 08/10] rbd: Revert -blockdev and -drive parameter auth-supported, Jeff Cody, 2017/03/28
- [Qemu-block] [PULL for-2.9 10/10] rbd: Fix bugs around -drive parameter "server", Jeff Cody, 2017/03/28
- [Qemu-block] [PULL for-2.9 09/10] rbd: Revert -blockdev parameter password-secret, Jeff Cody, 2017/03/28
- Re: [Qemu-block] [PULL for-2.9 00/10] Block patches for -rc2, Peter Maydell, 2017/03/28