qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 10/10] block: print errno on error


From: Paolo Bonzini
Subject: [Qemu-devel] Re: [PATCH 10/10] block: print errno on error
Date: Wed, 03 Mar 2010 15:36:04 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100120 Fedora/3.0.1-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.1


diff --git a/qemu-img.c b/qemu-img.c
index 0c9f2d4..f6c40fb 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("Error (%s) while formatting for file format '%s'", 
strerror(ret), fmt);
          }
      }
      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("Error (%s) while formatting file '%s'", strerror(ret), 
out_filename);
          }
      }


I think it should be strerror(-ret) in both cases.

Yes; also, since you are at it, I think that respectively

error("%s: error while creating %s image: %s", filename, fmt,
      strerror(-ret);

error(%s: error while converting to %s: %s", out_filename, fmt,
      strerror(-ret);

would be more consistent with usual error messages:

$ cat fdsfds
cat: fdsfds: No such file or directory

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]