提交 2cfa571f 编写于 作者: M Mark McLoughlin 提交者: Anthony Liguori

Make qemu_opts_parse() handle empty strings

Rather than making callers explicitly handle empty strings by using
qemu_opts_create(), we can easily have qemu_opts_parse() handle
empty parameter strings.
Signed-off-by: NMark McLoughlin <markmc@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 b386becf
......@@ -712,8 +712,7 @@ int qemu_opts_do_parse(QemuOpts *opts, const char *params, const char *firstname
char option[128], value[128];
const char *p,*pe,*pc;
p = params;
for(;;) {
for (p = params; *p != '\0'; p++) {
pe = strchr(p, '=');
pc = strchr(p, ',');
if (!pe || (pc && pc < pe)) {
......@@ -750,7 +749,6 @@ int qemu_opts_do_parse(QemuOpts *opts, const char *params, const char *firstname
if (*p != ',') {
break;
}
p++;
}
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册