* [PATCH] blockdev: Use error_report() in hmp_commit()
@ 2019-10-15 12:39 Kevin Wolf
2019-10-15 13:59 ` Eric Blake
2019-10-15 15:37 ` Philippe Mathieu-Daudé
0 siblings, 2 replies; 3+ messages in thread
From: Kevin Wolf @ 2019-10-15 12:39 UTC (permalink / raw)
To: qemu-block; +Cc: kwolf, qemu-devel
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));
}
}
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] blockdev: Use error_report() in hmp_commit()
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é
1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2019-10-15 13:59 UTC (permalink / raw)
To: Kevin Wolf, qemu-block; +Cc: qemu-devel
On 10/15/19 7:39 AM, 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(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] blockdev: Use error_report() in hmp_commit()
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é
1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-10-15 15:37 UTC (permalink / raw)
To: Kevin Wolf, qemu-block; +Cc: qemu-devel
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>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-10-15 15:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.