qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [Qemu-devel] [PATCH] vl: Print maxmem in hex format f


From: Eric Blake
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] vl: Print maxmem in hex format for error message
Date: Mon, 15 Sep 2014 20:42:28 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0

On 09/15/2014 08:36 PM, zhanghailiang wrote:
> In error message, maxmem is printed in Dec but ram_size in Hex.
> It is better to print them in same format.
> Also use error_report instead of fprintf.
> 
> Signed-off-by: zhanghailiang <address@hidden>
> ---
>  vl.c | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/vl.c b/vl.c
> index 5db0d08..ea60f93 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -3358,34 +3358,34 @@ int main(int argc, char **argv, char **envp)
>  
>                      sz = qemu_opt_get_size(opts, "maxmem", 0);
>                      if (sz < ram_size) {
> -                        fprintf(stderr, "qemu: invalid -m option value: 
> maxmem "
> -                                "(%" PRIu64 ") <= initial memory ("
> -                                RAM_ADDR_FMT ")\n", sz, ram_size);
> +                        error_report("qemu: invalid -m option value: maxmem "
> +                                "(0x%" PRIx64 ") <= initial memory (0x"
> +                                RAM_ADDR_FMT ")", sz, ram_size);
>                          exit(EXIT_FAILURE);
>                      }
>  
>                      slots = qemu_opt_get_number(opts, "slots", 0);
>                      if ((sz > ram_size) && !slots) {
> -                        fprintf(stderr, "qemu: invalid -m option value: 
> maxmem "
> -                                "(%" PRIu64 ") more than initial memory ("
> +                        error_report("qemu: invalid -m option value: maxmem "

doesn't error_report already prepend  a variation of "qemu", making your
"qemu: " redundant?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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