summaryrefslogtreecommitdiff
path: root/block/rbd.c
diff options
context:
space:
mode:
authorJeff Cody <jcody@redhat.com>2017-02-27 01:03:53 -0500
committerJeff Cody <jcody@redhat.com>2017-02-28 11:32:25 -0500
commit0f9d252de4a377cbdd9f05537b4b0b8893ab7979 (patch)
treeab1b5dd90c75ed5527e7f489c3f5d4087ed10b1a /block/rbd.c
parent7830f909981361a3d694f4899d5cd7b159841d9e (diff)
downloadqemu-0f9d252de4a377cbdd9f05537b4b0b8893ab7979.tar.gz
block/rbd: add all the currently supported runtime_opts
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>
Diffstat (limited to 'block/rbd.c')
-rw-r--r--block/rbd.c68
1 files changed, 49 insertions, 19 deletions
diff --git a/block/rbd.c b/block/rbd.c
index 33c21d8798..67d680c1cc 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)
{