diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2009-07-31 12:25:33 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-08-10 13:05:26 -0500 |
commit | d3afade09e95f94a8da55dfe144bc61657aaca8b (patch) | |
tree | 91bb1af4bb6d5f5c38b0b7fb226393303774726f /qemu-option.c | |
parent | 84ed800e03d9be37536702bcf443255e0a8f975f (diff) | |
download | qemu-d3afade09e95f94a8da55dfe144bc61657aaca8b.tar.gz qemu-d3afade09e95f94a8da55dfe144bc61657aaca8b.tar.bz2 qemu-d3afade09e95f94a8da55dfe144bc61657aaca8b.zip |
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 <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Message-Id:
Diffstat (limited to 'qemu-option.c')
-rw-r--r-- | qemu-option.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/qemu-option.c b/qemu-option.c index 7164ee8da2..61141e0bd6 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; |