[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 for-2.9 04/10] rbd: Clean up after the previous c
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PATCH v4 for-2.9 04/10] rbd: Clean up after the previous commit |
Date: |
Tue, 28 Mar 2017 10:56:02 +0200 |
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 <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>
---
block/rbd.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)
diff --git a/block/rbd.c b/block/rbd.c
index 0fea348..182a5a3 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) {
--
2.7.4
- [Qemu-devel] [PATCH v4 for-2.9 00/10] rbd: Clean up API and code, Markus Armbruster, 2017/03/28
- [Qemu-devel] [PATCH v4 for-2.9 09/10] rbd: Revert -blockdev parameter password-secret, Markus Armbruster, 2017/03/28
- [Qemu-devel] [PATCH v4 for-2.9 07/10] rbd: Clean up qemu_rbd_create()'s detour through QemuOpts, Markus Armbruster, 2017/03/28
- [Qemu-devel] [PATCH v4 for-2.9 01/10] rbd: Reject -blockdev server.*.{numeric, to, ipv4, ipv6}, Markus Armbruster, 2017/03/28
- [Qemu-devel] [PATCH v4 for-2.9 04/10] rbd: Clean up after the previous commit,
Markus Armbruster <=
- [Qemu-devel] [PATCH v4 for-2.9 05/10] rbd: Don't accept -drive driver=rbd, keyvalue-pairs=..., Markus Armbruster, 2017/03/28
- [Qemu-devel] [PATCH v4 for-2.9 02/10] rbd: Fix to cleanly reject -drive without pool or image, Markus Armbruster, 2017/03/28
- [Qemu-devel] [PATCH v4 for-2.9 03/10] rbd: Don't limit length of parameter values, Markus Armbruster, 2017/03/28
- [Qemu-devel] [PATCH v4 for-2.9 06/10] rbd: Clean up runtime_opts, fix -drive to reject filename, Markus Armbruster, 2017/03/28
- [Qemu-devel] [PATCH v4 for-2.9 08/10] rbd: Revert -blockdev and -drive parameter auth-supported, Markus Armbruster, 2017/03/28
- [Qemu-devel] [PATCH v4 for-2.9 10/10] rbd: Fix bugs around -drive parameter "server", Markus Armbruster, 2017/03/28
- Re: [Qemu-devel] [PATCH v4 for-2.9 00/10] rbd: Clean up API and code, Jeff Cody, 2017/03/28