aboutsummaryrefslogtreecommitdiff
path: root/block/rbd.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2017-04-27 16:58:17 -0500
committerMarkus Armbruster <armbru@redhat.com>2017-05-09 09:13:51 +0200
commit46f5ac205a9dc5e2c24274c7df371509a286281f (patch)
tree52cd3eab32f34963a5275f6f291386d4ad8b6624 /block/rbd.c
parenta92c21591b5bb9543996538f14854ca6b528318b (diff)
qobject: Use simpler QDict/QList scalar insertion macros
We now have macros in place to make it less verbose to add a scalar to QDict and QList, so use them. Patch created mechanically via: spatch --sp-file scripts/coccinelle/qobject.cocci \ --macro-file scripts/cocci-macro-file.h --dir . --in-place then touched up manually to fix a couple of '?:' back to original spacing, as well as avoiding a long line in monitor.c. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20170427215821.19397-7-eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'block/rbd.c')
-rw-r--r--block/rbd.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/block/rbd.c b/block/rbd.c
index fbf30591d1..e551639e47 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -154,20 +154,20 @@ static void qemu_rbd_parse_filename(const char *filename, QDict *options,
goto done;
}
qemu_rbd_unescape(found_str);
- qdict_put(options, "pool", qstring_from_str(found_str));
+ qdict_put_str(options, "pool", found_str);
if (strchr(p, '@')) {
found_str = qemu_rbd_next_tok(p, '@', &p);
qemu_rbd_unescape(found_str);
- qdict_put(options, "image", qstring_from_str(found_str));
+ qdict_put_str(options, "image", found_str);
found_str = qemu_rbd_next_tok(p, ':', &p);
qemu_rbd_unescape(found_str);
- qdict_put(options, "snapshot", qstring_from_str(found_str));
+ qdict_put_str(options, "snapshot", found_str);
} else {
found_str = qemu_rbd_next_tok(p, ':', &p);
qemu_rbd_unescape(found_str);
- qdict_put(options, "image", qstring_from_str(found_str));
+ qdict_put_str(options, "image", found_str);
}
if (!p) {
goto done;
@@ -189,9 +189,9 @@ static void qemu_rbd_parse_filename(const char *filename, QDict *options,
qemu_rbd_unescape(value);
if (!strcmp(name, "conf")) {
- qdict_put(options, "conf", qstring_from_str(value));
+ qdict_put_str(options, "conf", value);
} else if (!strcmp(name, "id")) {
- qdict_put(options, "user" , qstring_from_str(value));
+ qdict_put_str(options, "user", value);
} else {
/*
* We pass these internally to qemu_rbd_set_keypairs(), so
@@ -204,8 +204,8 @@ static void qemu_rbd_parse_filename(const char *filename, QDict *options,
if (!keypairs) {
keypairs = qlist_new();
}
- qlist_append(keypairs, qstring_from_str(name));
- qlist_append(keypairs, qstring_from_str(value));
+ qlist_append_str(keypairs, name);
+ qlist_append_str(keypairs, value);
}
}