From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9Aww-000514-Jx for qemu-devel@nongnu.org; Wed, 05 Sep 2012 04:27:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9Awv-00056H-Hy for qemu-devel@nongnu.org; Wed, 05 Sep 2012 04:27:02 -0400 From: riegamaths@gmail.com Date: Wed, 5 Sep 2012 16:26:14 +0800 Message-Id: <1346833574-26193-1-git-send-email-riegamaths@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] =?utf-8?q?=5BPATCH=5D_block=3A_output_more_error_mes?= =?utf-8?q?sages_if_failed_to_create_temporary_snapshot?= List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Cc: qemu-trivial , Dunrong Huang From: Dunrong Huang 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 --- 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