qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH] blockdev: Use error_report() in hmp_commit()
Date: Tue, 15 Oct 2019 17:37:42 +0200	[thread overview]
Message-ID: <4a1867c3-ffe3-2252-ee96-9325b3ed7f2d@redhat.com> (raw)
In-Reply-To: <20191015123932.12214-1-kwolf@redhat.com>

On 10/15/19 2:39 PM, Kevin Wolf wrote:
> Instead of using monitor_printf() to report errors, hmp_commit() should
> use error_report() like other places do.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>   blockdev.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/blockdev.c b/blockdev.c
> index f89e48fc79..e2358966c3 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -1088,11 +1088,11 @@ void hmp_commit(Monitor *mon, const QDict *qdict)
>   
>           blk = blk_by_name(device);
>           if (!blk) {
> -            monitor_printf(mon, "Device '%s' not found\n", device);
> +            error_report("Device '%s' not found", device);
>               return;
>           }
>           if (!blk_is_available(blk)) {
> -            monitor_printf(mon, "Device '%s' has no medium\n", device);
> +            error_report("Device '%s' has no medium", device);
>               return;
>           }
>   
> @@ -1105,8 +1105,7 @@ void hmp_commit(Monitor *mon, const QDict *qdict)
>           aio_context_release(aio_context);
>       }
>       if (ret < 0) {
> -        monitor_printf(mon, "'commit' error for '%s': %s\n", device,
> -                       strerror(-ret));
> +        error_report("'commit' error for '%s': %s", device, strerror(-ret));
>       }
>   }
>   
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>


      parent reply	other threads:[~2019-10-15 15:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15 12:39 [PATCH] blockdev: Use error_report() in hmp_commit() Kevin Wolf
2019-10-15 13:59 ` Eric Blake
2019-10-15 15:37 ` Philippe Mathieu-Daudé [this message]

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=4a1867c3-ffe3-2252-ee96-9325b3ed7f2d@redhat.com \
    --to=philmd@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).