]> git.proxmox.com Git - qemu.git/commitdiff
qemu-option: fix parse_option_number().
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 29 Jul 2009 08:39:59 +0000 (10:39 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 30 Jul 2009 14:50:37 +0000 (09:50 -0500)
It works much better when parse_option_number actually
returns the number parsed ...

Common breakage resulting from this bug is that
'qemu -hda foo.img -cdrom bar.iso' stops working
(cdrom isn't there).

Cc: Avi Kivity <avi@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-option.c

index 73c21754928882e7fb2fa617a92064d4ebf1d6b6..591d178999d380d2008e07b741cdbc5513193d18 100644 (file)
@@ -193,6 +193,7 @@ static int parse_option_number(const char *name, const char *value, uint64_t *re
             fprintf(stderr, "Option '%s' needs a number as parameter\n", name);
             return -1;
         }
+        *ret = number;
     } else {
         fprintf(stderr, "Option '%s' needs a parameter\n", name);
         return -1;