qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 2/5] QemuOpts: qemu_opts_parse: fix id= parsing
Date: Thu, 30 Jul 2009 12:43:38 +0200	[thread overview]
Message-ID: <1248950621-22249-3-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1248950621-22249-1-git-send-email-kraxel@redhat.com>

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>
---
 qemu-option.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/qemu-option.c b/qemu-option.c
index 86c0b09..cee7dff 100644
--- a/qemu-option.c
+++ b/qemu-option.c
@@ -714,8 +714,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

  parent reply	other threads:[~2009-07-30 10:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-30 10:43 [Qemu-devel] [PATCH 0/5] QemuOpts patches Gerd Hoffmann
2009-07-30 10:43 ` [Qemu-devel] [PATCH 1/5] QemuOpts: add some functions Gerd Hoffmann
2009-07-30 10:43 ` Gerd Hoffmann [this message]
2009-07-30 10:43 ` [Qemu-devel] [PATCH 3/5] QemuOpts: make the drive id actually show up in "info block" Gerd Hoffmann
2009-07-30 10:43 ` [Qemu-devel] [PATCH 4/5] QemuOpts: add -drive-set option Gerd Hoffmann
2009-07-30 13:58   ` Anthony Liguori
2009-07-30 14:35     ` Gerd Hoffmann
2009-07-30 18:44       ` Anthony Liguori
2009-07-30 10:43 ` [Qemu-devel] [PATCH 5/5] QemuOpts: switch over -device Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1248950621-22249-3-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).