aboutsummaryrefslogtreecommitdiff
path: root/block/rbd.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2017-03-28 10:56:02 +0200
committerJeff Cody <jcody@redhat.com>2017-03-28 09:53:16 -0400
commit8efb339dd47b164429e9a57f36ac5c3dd810a4ce (patch)
treeb2812bfb0e54528934368797c6eacd9aee0ae8bb /block/rbd.c
parent730b00bbfdc15f914f47e03a703fa7647c10c4a9 (diff)
rbd: Clean up after the previous commit
This code in qemu_rbd_parse_filename() found_str = qemu_rbd_next_tok(p, '\0', &p); p = found_str; has no effect. Drop it, and simplify qemu_rbd_next_tok(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Message-id: 1490691368-32099-5-git-send-email-armbru@redhat.com Signed-off-by: Jeff Cody <jcody@redhat.com>
Diffstat (limited to 'block/rbd.c')
-rw-r--r--block/rbd.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/block/rbd.c b/block/rbd.c
index 0fea348bdb..182a5a35ff 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -104,19 +104,17 @@ static char *qemu_rbd_next_tok(char *src, char delim, char **p)
*p = NULL;
- if (delim != '\0') {
- for (end = src; *end; ++end) {
- if (*end == delim) {
- break;
- }
- if (*end == '\\' && end[1] != '\0') {
- end++;
- }
- }
+ for (end = src; *end; ++end) {
if (*end == delim) {
- *p = end + 1;
- *end = '\0';
+ break;
}
+ if (*end == '\\' && end[1] != '\0') {
+ end++;
+ }
+ }
+ if (*end == delim) {
+ *p = end + 1;
+ *end = '\0';
}
return src;
}
@@ -177,10 +175,6 @@ static void qemu_rbd_parse_filename(const char *filename, QDict *options,
goto done;
}
- found_str = qemu_rbd_next_tok(p, '\0', &p);
-
- p = found_str;
-
/* The following are essentially all key/value pairs, and we treat
* 'id' and 'conf' a bit special. Key/value pairs may be in any order. */
while (p) {