From: Juan Quintela Date: Thu, 4 Mar 2010 09:00:38 +0000 (+0100) Subject: block: print errno on error X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3e7896dec40ec5b9a51338fa636a58014d6d3f94;p=qemu.git block: print errno on error Now that we changed all create calls to return errno, just print it. Signed-off-by: Juan Quintela Signed-off-by: Anthony Liguori --- diff --git a/qemu-img.c b/qemu-img.c index 466fdef623..9b28664a30 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -374,7 +374,7 @@ static int img_create(int argc, char **argv) } else if (ret == -EFBIG) { error("The image size is too large for file format '%s'", fmt); } else { - error("Error while formatting"); + error("%s: error while creating %s: %s", filename, fmt, strerror(-ret)); } } return 0; @@ -687,7 +687,7 @@ static int img_convert(int argc, char **argv) } else if (ret == -EFBIG) { error("The image size is too large for file format '%s'", out_fmt); } else { - error("Error while formatting '%s'", out_filename); + error("%s: error while converting %s: %s", out_filename, out_fmt, strerror(-ret)); } }