qemu-option: fix parse_option_number().

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>
This commit is contained in:
Gerd Hoffmann 2009-07-29 10:39:59 +02:00 committed by Anthony Liguori
parent a414c306c0
commit 21c9f4cdc6

View 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;