Patchwork [5/7] qemu-img create: Emit filename on error

login
register
mail settings
Submitter Max Reitz
Date Sept. 10, 2013, 2:49 p.m.
Message ID <1378824578-30394-6-git-send-email-mreitz@redhat.com>
Download mbox | patch
Permalink /patch/273895/
State New
Headers show

Comments

Max Reitz - Sept. 10, 2013, 2:49 p.m.
bdrv_img_create generally does not emit the target filename, although
this is pretty important information. Therefore, prepend its error
message with the output filename (if an error occurs).

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 qemu-img.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/qemu-img.c b/qemu-img.c
index a8b82ad..20d8c02 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -412,7 +412,7 @@  static int img_create(int argc, char **argv)
     bdrv_img_create(filename, fmt, base_filename, base_fmt,
                     options, img_size, BDRV_O_FLAGS, &local_err, quiet);
     if (error_is_set(&local_err)) {
-        error_report("%s", error_get_pretty(local_err));
+        error_report("%s: %s", filename, error_get_pretty(local_err));
         error_free(local_err);
         return 1;
     }