From: Jeff Cody <jcody@redhat.com>
To: qemu-block@nongnu.org
Cc: peter.maydell@linaro.org, jcody@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL v2 2/5] block/rbd: add all the currently supported runtime_opts
Date: Tue, 28 Feb 2017 11:34:33 -0500 [thread overview]
Message-ID: <20170228163436.31357-3-jcody@redhat.com> (raw)
In-Reply-To: <20170228163436.31357-1-jcody@redhat.com>
This adds all the currently supported runtime opts, which
are the options as parsed from the filename. All of these
options are explicitly checked for during during runtime,
with an exception to the "keyvalue-pairs" option.
This option contains all the key/value pairs that the QEMU rbd
driver merely unescapes, and passes along blindly to rados. This
option is a "legacy" option, and will not be exposed in the QAPI
or available for introspection.
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Jeff Cody <jcody@redhat.com>
---
block/rbd.c | 68 ++++++++++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 49 insertions(+), 19 deletions(-)
diff --git a/block/rbd.c b/block/rbd.c
index 33c21d8..67d680c 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -357,6 +357,55 @@ static void qemu_rbd_memset(RADOSCB *rcb, int64_t offs)
}
}
+static QemuOptsList runtime_opts = {
+ .name = "rbd",
+ .head = QTAILQ_HEAD_INITIALIZER(runtime_opts.head),
+ .desc = {
+ {
+ .name = "filename",
+ .type = QEMU_OPT_STRING,
+ .help = "Specification of the rbd image",
+ },
+ {
+ .name = "password-secret",
+ .type = QEMU_OPT_STRING,
+ .help = "ID of secret providing the password",
+ },
+ {
+ .name = "conf",
+ .type = QEMU_OPT_STRING,
+ .help = "Rados config file location",
+ },
+ {
+ .name = "pool",
+ .type = QEMU_OPT_STRING,
+ .help = "Rados pool name",
+ },
+ {
+ .name = "image",
+ .type = QEMU_OPT_STRING,
+ .help = "Image name in the pool",
+ },
+ {
+ .name = "snapshot",
+ .type = QEMU_OPT_STRING,
+ .help = "Ceph snapshot name",
+ },
+ {
+ /* maps to 'id' in rados_create() */
+ .name = "user",
+ .type = QEMU_OPT_STRING,
+ .help = "Rados id name",
+ },
+ {
+ .name = "keyvalue-pairs",
+ .type = QEMU_OPT_STRING,
+ .help = "Legacy rados key/value option parameters",
+ },
+ { /* end of list */ }
+ },
+};
+
static int qemu_rbd_create(const char *filename, QemuOpts *opts, Error **errp)
{
Error *local_err = NULL;
@@ -500,25 +549,6 @@ static void qemu_rbd_complete_aio(RADOSCB *rcb)
qemu_aio_unref(acb);
}
-/* TODO Convert to fine grained options */
-static QemuOptsList runtime_opts = {
- .name = "rbd",
- .head = QTAILQ_HEAD_INITIALIZER(runtime_opts.head),
- .desc = {
- {
- .name = "filename",
- .type = QEMU_OPT_STRING,
- .help = "Specification of the rbd image",
- },
- {
- .name = "password-secret",
- .type = QEMU_OPT_STRING,
- .help = "ID of secret providing the password",
- },
- { /* end of list */ }
- },
-};
-
static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
--
2.9.3
next prev parent reply other threads:[~2017-02-28 16:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-28 16:34 [Qemu-devel] [PULL v2 0/5] Block patches for 2.9 Jeff Cody
2017-02-28 16:34 ` [Qemu-devel] [PULL v2 1/5] block/rbd: don't copy strings in qemu_rbd_next_tok() Jeff Cody
2017-02-28 16:34 ` Jeff Cody [this message]
2017-02-28 16:34 ` [Qemu-devel] [PULL v2 3/5] block/rbd: parse all options via bdrv_parse_filename Jeff Cody
2017-02-28 16:34 ` [Qemu-devel] [PULL v2 4/5] block/rbd: add blockdev-add support Jeff Cody
2017-02-28 16:34 ` [Qemu-devel] [PULL v2 5/5] block/rbd: add support for 'mon_host', 'auth_supported' via QAPI Jeff Cody
2017-02-28 17:31 ` [Qemu-devel] [PULL v2 0/5] Block patches for 2.9 no-reply
2017-02-28 21:21 ` Jeff Cody
2017-03-01 16:30 ` Peter Maydell
2017-03-02 3:47 ` Jeff Cody
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170228163436.31357-3-jcody@redhat.com \
--to=jcody@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).