qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] sheepdog: Fix misleading error messages in sd_snapshot_create()
@ 2015-02-12 13:49 Markus Armbruster
  2015-02-12 15:15 ` Eric Blake
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Markus Armbruster @ 2015-02-12 13:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: mitake.hitoshi, namei.unix, sheepdog, stefanha, kwolf

If do_sd_create() fails, it first reports the error returned, then
reports a another one with strerror(errno).  errno is meaningless at
that point.

Report just one error combining the valid information from both
messages.

Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
Applies on top of my "[PATCH v2 00/10] Clean up around
error_get_pretty(), qerror_report_err()", but rebasing to master would
be trivial.

 block/sheepdog.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/block/sheepdog.c b/block/sheepdog.c
index 6a4a3bd..0e8c712 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -2225,9 +2225,8 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
 
     ret = do_sd_create(s, &new_vid, 1, &local_err);
     if (ret < 0) {
-        error_report_err(local_err);
-        error_report("failed to create inode for snapshot. %s",
-                     strerror(errno));
+        error_report("failed to create inode for snapshot: %s",
+                     error_get_pretty(local_err));
         goto cleanup;
     }
 
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] sheepdog: Fix misleading error messages in sd_snapshot_create()
  2015-02-12 13:49 [Qemu-devel] [PATCH] sheepdog: Fix misleading error messages in sd_snapshot_create() Markus Armbruster
@ 2015-02-12 15:15 ` Eric Blake
  2015-02-13  3:57 ` Liu Yuan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Eric Blake @ 2015-02-12 15:15 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel
  Cc: mitake.hitoshi, namei.unix, kwolf, sheepdog, stefanha

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

On 02/12/2015 06:49 AM, Markus Armbruster wrote:
> If do_sd_create() fails, it first reports the error returned, then
> reports a another one with strerror(errno).  errno is meaningless at
> that point.
> 
> Report just one error combining the valid information from both
> messages.
> 
> Reported-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> Applies on top of my "[PATCH v2 00/10] Clean up around
> error_get_pretty(), qerror_report_err()", but rebasing to master would
> be trivial.
> 
>  block/sheepdog.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
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: 604 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] sheepdog: Fix misleading error messages in sd_snapshot_create()
  2015-02-12 13:49 [Qemu-devel] [PATCH] sheepdog: Fix misleading error messages in sd_snapshot_create() Markus Armbruster
  2015-02-12 15:15 ` Eric Blake
@ 2015-02-13  3:57 ` Liu Yuan
  2015-02-27 12:56 ` Markus Armbruster
  2015-03-04 13:03 ` Kevin Wolf
  3 siblings, 0 replies; 5+ messages in thread
From: Liu Yuan @ 2015-02-13  3:57 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: mitake.hitoshi, kwolf, sheepdog, qemu-devel, stefanha

On Thu, Feb 12, 2015 at 02:49:50PM +0100, Markus Armbruster wrote:
> If do_sd_create() fails, it first reports the error returned, then
> reports a another one with strerror(errno).  errno is meaningless at
> that point.
> 
> Report just one error combining the valid information from both
> messages.
> 
> Reported-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> Applies on top of my "[PATCH v2 00/10] Clean up around
> error_get_pretty(), qerror_report_err()", but rebasing to master would
> be trivial.
> 
>  block/sheepdog.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/block/sheepdog.c b/block/sheepdog.c
> index 6a4a3bd..0e8c712 100644
> --- a/block/sheepdog.c
> +++ b/block/sheepdog.c
> @@ -2225,9 +2225,8 @@ static int sd_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
>  
>      ret = do_sd_create(s, &new_vid, 1, &local_err);
>      if (ret < 0) {
> -        error_report_err(local_err);
> -        error_report("failed to create inode for snapshot. %s",
> -                     strerror(errno));
> +        error_report("failed to create inode for snapshot: %s",
> +                     error_get_pretty(local_err));
>          goto cleanup;
>      }

Reviewed-by: Liu Yuan <namei.unix@gmail.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] sheepdog: Fix misleading error messages in sd_snapshot_create()
  2015-02-12 13:49 [Qemu-devel] [PATCH] sheepdog: Fix misleading error messages in sd_snapshot_create() Markus Armbruster
  2015-02-12 15:15 ` Eric Blake
  2015-02-13  3:57 ` Liu Yuan
@ 2015-02-27 12:56 ` Markus Armbruster
  2015-03-04 13:03 ` Kevin Wolf
  3 siblings, 0 replies; 5+ messages in thread
From: Markus Armbruster @ 2015-02-27 12:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: mitake.hitoshi, namei.unix, sheepdog, stefanha, kwolf

Markus Armbruster <armbru@redhat.com> writes:

> If do_sd_create() fails, it first reports the error returned, then
> reports a another one with strerror(errno).  errno is meaningless at
> that point.
>
> Report just one error combining the valid information from both
> messages.
>
> Reported-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> Applies on top of my "[PATCH v2 00/10] Clean up around
> error_get_pretty(), qerror_report_err()", but rebasing to master would
> be trivial.

Applies cleanly on master now.  Maintainers, please apply.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] sheepdog: Fix misleading error messages in sd_snapshot_create()
  2015-02-12 13:49 [Qemu-devel] [PATCH] sheepdog: Fix misleading error messages in sd_snapshot_create() Markus Armbruster
                   ` (2 preceding siblings ...)
  2015-02-27 12:56 ` Markus Armbruster
@ 2015-03-04 13:03 ` Kevin Wolf
  3 siblings, 0 replies; 5+ messages in thread
From: Kevin Wolf @ 2015-03-04 13:03 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: mitake.hitoshi, namei.unix, sheepdog, qemu-devel, stefanha

Am 12.02.2015 um 14:49 hat Markus Armbruster geschrieben:
> If do_sd_create() fails, it first reports the error returned, then
> reports a another one with strerror(errno).  errno is meaningless at
> that point.
> 
> Report just one error combining the valid information from both
> messages.
> 
> Reported-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Thanks, applied to the block branch.

Kevin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-04 13:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-12 13:49 [Qemu-devel] [PATCH] sheepdog: Fix misleading error messages in sd_snapshot_create() Markus Armbruster
2015-02-12 15:15 ` Eric Blake
2015-02-13  3:57 ` Liu Yuan
2015-02-27 12:56 ` Markus Armbruster
2015-03-04 13:03 ` Kevin Wolf

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).