提交 21c9f4cd 编写于 作者: G Gerd Hoffmann 提交者: Anthony Liguori

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: NGerd Hoffmann <kraxel@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 a414c306
...@@ -193,6 +193,7 @@ static int parse_option_number(const char *name, const char *value, uint64_t *re ...@@ -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); fprintf(stderr, "Option '%s' needs a number as parameter\n", name);
return -1; return -1;
} }
*ret = number;
} else { } else {
fprintf(stderr, "Option '%s' needs a parameter\n", name); fprintf(stderr, "Option '%s' needs a parameter\n", name);
return -1; return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册