All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: zhanghailiang <zhang.zhanghailiang@huawei.com>, qemu-trivial@nongnu.org
Cc: luonengjun@huawei.com, qemu-devel@nongnu.org, peter.huangpeng@huawei.com
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	[thread overview]
Message-ID: <5417A394.7050104@redhat.com> (raw)
In-Reply-To: <1410835011-13292-1-git-send-email-zhang.zhanghailiang@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 1769 bytes --]

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 <zhang.zhanghailiang@huawei.com>
> ---
>  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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Eric Blake <eblake@redhat.com>
To: zhanghailiang <zhang.zhanghailiang@huawei.com>, qemu-trivial@nongnu.org
Cc: luonengjun@huawei.com, qemu-devel@nongnu.org, peter.huangpeng@huawei.com
Subject: Re: [Qemu-devel] [PATCH] vl: Print maxmem in hex format for error message
Date: Mon, 15 Sep 2014 20:42:28 -0600	[thread overview]
Message-ID: <5417A394.7050104@redhat.com> (raw)
In-Reply-To: <1410835011-13292-1-git-send-email-zhang.zhanghailiang@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 1769 bytes --]

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 <zhang.zhanghailiang@huawei.com>
> ---
>  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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]

  reply	other threads:[~2014-09-16  2:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-16  2:36 [Qemu-trivial] [PATCH] vl: Print maxmem in hex format for error message zhanghailiang
2014-09-16  2:36 ` [Qemu-devel] " zhanghailiang
2014-09-16  2:42 ` Eric Blake [this message]
2014-09-16  2:42   ` Eric Blake
2014-09-16  2:51   ` [Qemu-trivial] " zhanghailiang
2014-09-16  2:51     ` zhanghailiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5417A394.7050104@redhat.com \
    --to=eblake@redhat.com \
    --cc=luonengjun@huawei.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=zhang.zhanghailiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.