From: Gerd Hoffmann Date: Fri, 31 Jul 2009 10:25:33 +0000 (+0200) Subject: QemuOpts: qemu_opts_parse: fix id= parsing X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~11144 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d378185c665c0edf3081f570c5b42dd3303f9b4;p=sdk%2Femulator%2Fqemu.git QemuOpts: qemu_opts_parse: fix id= parsing We can't use get_param_value(), it can't handle parameters without '=' in there. Examples not working because of that: -device foo,id=bar -device file=/path/image,format=qcow2,snapshot,id=disk0 Signed-off-by: Gerd Hoffmann Signed-off-by: Anthony Liguori Message-Id: --- diff --git a/qemu-option.c b/qemu-option.c index 7164ee8..61141e0 100644 --- a/qemu-option.c +++ b/qemu-option.c @@ -715,8 +715,13 @@ QemuOpts *qemu_opts_parse(QemuOptsList *list, const char *params, const char *fi QemuOpts *opts; const char *p,*pe,*pc; - if (get_param_value(value, sizeof(value), "id", params)) + if (strncmp(params, "id=", 3) == 0) { + get_opt_value(value, sizeof(value), params+3); id = qemu_strdup(value); + } else if ((p = strstr(params, ",id=")) != NULL) { + get_opt_value(value, sizeof(value), p+4); + id = qemu_strdup(value); + } opts = qemu_opts_create(list, id, 1); if (opts == NULL) return NULL;