qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V18 05/25] qemu-option: opt->str store digit, wi


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH V18 05/25] qemu-option: opt->str store digit, without suffixes
Date: Tue, 27 Aug 2013 16:01:15 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 13.08.2013 um 06:31 hat Dong Xu Wang geschrieben:
> To produce same output while using "qemu-img create", opt->str
> should store pure digit, without suffixes.
> 
> Signed-off-by: Dong Xu Wang <address@hidden>
> ---
>  util/qemu-option.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/util/qemu-option.c b/util/qemu-option.c
> index b939e8a..861929d 100644
> --- a/util/qemu-option.c
> +++ b/util/qemu-option.c
> @@ -675,6 +675,8 @@ static void qemu_opt_parse(QemuOpt *opt, Error **errp)
>          break;
>      case QEMU_OPT_SIZE:
>          parse_option_size(opt->name, opt->str, &opt->value.uint, errp);
> +        g_free((char *)opt->str);
> +        opt->str = g_strdup(stringify(opt->value_uint));

This is wrong, stringify() is a macro at compile time. You get
"opt->value_uint" for any option here.

You're probably looking for g_strdup_printf().

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]