qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: output more error messages if failed to create temporary snapshot
@ 2012-09-05  8:26 riegamaths
  2012-09-05  9:40 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
  0 siblings, 1 reply; 4+ messages in thread
From: riegamaths @ 2012-09-05  8:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Dunrong Huang

From: Dunrong Huang <riegamaths@gmail.com>

If we failed to create temporary snapshot, the error message did not match
with the error, for example:

$ TMPDIR=/tmp/bad_path qemu-system-x86_64 -enable-kvm debian.qcow2 -snapshot
qemu-system-x86_64: -enable-kvm: could not open disk image /home/mathslinux/Images/debian.qcow2: No such file or directory

Indeed, the file which cant be created is /tmp/bad_path/vl.xxxxxx,  not
debian.qcow2. so the error message makes users feel confused.

Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
---
 block.c | 2 ++
 1 个文件被修改,插入 2 行(+)

diff --git a/block.c b/block.c
index 470bdcc..c9e5140 100644
--- a/block.c
+++ b/block.c
@@ -434,6 +434,8 @@ int get_tmp_filename(char *filename, int size)
     }
     fd = mkstemp(filename);
     if (fd < 0 || close(fd)) {
+        fprintf(stderr, "Could not create temporary snapshot in %s directory: "
+                "%s\n", tmpdir, strerror(errno));
         return -errno;
     }
     return 0;
-- 
1.7.12

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

end of thread, other threads:[~2012-09-05 12:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-05  8:26 [Qemu-devel] [PATCH] block: output more error messages if failed to create temporary snapshot riegamaths
2012-09-05  9:40 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
2012-09-05 10:35   ` Kevin Wolf
2012-09-05 12:52     ` Dunrong Huang

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