Patchwork Fix regression in option parsing

login
register
mail settings
Submitter Anthony Liguori
Date Jan. 27, 2010, 4:47 p.m.
Message ID <1264610872-11802-1-git-send-email-aliguori@us.ibm.com>
Download mbox | patch
Permalink /patch/43825/
State New
Headers show

Comments

Anthony Liguori - Jan. 27, 2010, 4:47 p.m.
Commit ec229bbe7 broke invocation without a specific -hda.  IOW, qemu foo.img.
The lack of an optind update caused an infinite loop.

Reported-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 vl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Patch

diff --git a/vl.c b/vl.c
index 1cd355c..6f1e1ab 100644
--- a/vl.c
+++ b/vl.c
@@ -4819,6 +4819,7 @@  int main(int argc, char **argv, char **envp)
     while (optind < argc) {
         if (argv[optind][0] != '-') {
             /* disk image */
+            optind++;
             continue;
         } else {
             const QEMUOption *popt;