[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/10] QemuOpts: qemu_opts_parse: fix id= parsing
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 02/10] QemuOpts: qemu_opts_parse: fix id= parsing |
Date: |
Fri, 31 Jul 2009 12:25:33 +0200 |
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 <address@hidden>
---
qemu-option.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
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;
--
1.6.2.5
- [Qemu-devel] [PATCH 0/10] QemuOpts+qdev patches., Gerd Hoffmann, 2009/07/31
- [Qemu-devel] [PATCH 01/10] QemuOpts: add some functions, Gerd Hoffmann, 2009/07/31
- [Qemu-devel] [PATCH 02/10] QemuOpts: qemu_opts_parse: fix id= parsing,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 05/10] QemuOpts: add -set option, Gerd Hoffmann, 2009/07/31
- [Qemu-devel] [PATCH 03/10] QemuOpts: make the drive id actually show up in "info block"., Gerd Hoffmann, 2009/07/31
- [Qemu-devel] [PATCH 09/10] qdev/prop: add drive property., Gerd Hoffmann, 2009/07/31
- [Qemu-devel] [PATCH 07/10] constify drive_get_by_id arg, Gerd Hoffmann, 2009/07/31
- [Qemu-devel] [PATCH 08/10] add -drive if=none, Gerd Hoffmann, 2009/07/31
- [Qemu-devel] [PATCH 04/10] QemuOpts: create qemu-config.h, Gerd Hoffmann, 2009/07/31
- [Qemu-devel] [PATCH 10/10] qdev-ify virtio-blk., Gerd Hoffmann, 2009/07/31
- [Qemu-devel] [PATCH 06/10] QemuOpts: switch over -device., Gerd Hoffmann, 2009/07/31