[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [PATCH v3] block: output more error messages if faile
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-trivial] [PATCH v3] block: output more error messages if failed to create temporary snapshot |
Date: |
Wed, 05 Sep 2012 17:40:57 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 |
Il 05/09/2012 15:24, address@hidden ha scritto:
> From: Dunrong Huang <address@hidden>
>
> 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 <address@hidden>
> ---
> v1 -> v2:
> Output error message only if fd < 0
> v2 -> v3:
> Output error message in the caller of get_tmp_filename()
> block.c | 2 ++
> 1 个文件被修改,插入 2 行(+)
>
> diff --git a/block.c b/block.c
> index 470bdcc..074987e 100644
> --- a/block.c
> +++ b/block.c
> @@ -764,6 +764,8 @@ int bdrv_open(BlockDriverState *bs, const char *filename,
> int flags,
>
> ret = get_tmp_filename(tmp_filename, sizeof(tmp_filename));
> if (ret < 0) {
> + fprintf(stderr, "Could not create temporary snapshot %s: %s\n",
> + tmp_filename, strerror(errno));
> return ret;
> }
>
>
Looks good.
Paolo