qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-1.7 v2] block: Print its file name if backin


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH for-1.7 v2] block: Print its file name if backing file opening failed
Date: Mon, 11 Nov 2013 10:52:11 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Nov 08, 2013 at 11:26:49AM +0800, Fam Zheng wrote:
> If backing file doesn't exist, the error message is confusing and
> misleading:
> 
>     $ qemu /tmp/a.qcow2
>     qemu: could not open disk image /tmp/a.qcow2: Could not open file: No
>     such file or directory
> 
> But...
> 
>     $ ls /tmp/a.qcow2
>     /tmp/a.qcow2
> 
>     $ qemu-img info /tmp/a.qcow2
>     image: /tmp/a.qcow2
>     file format: qcow2
>     virtual size: 8.0G (8589934592 bytes)
>     disk size: 196K
>     cluster_size: 65536
>     backing file: /tmp/b.qcow2
> 
> Because...
> 
>     $ ls /tmp/b.qcow2
>     ls: cannot access /tmp/b.qcow2: No such file or directory
> 
> This is not intuitive. It's better to have the missing file's name in
> the error message. With this patch:
> 
>     $ qemu-io -c 'read 0 512' /tmp/a.qcow2
>     qemu-io: can't open device /tmp/a.qcow2: Could not open backing
>     file: Could not open '/stor/vm/arch.raw': No such file or directory
>     no file open, try 'help open'
> 
> Which is a little bit better.
> 
> Signed-off-by: Fam Zheng <address@hidden>
> 
> ---
> v2: Don't leak local_err (Eric).
> 
> Signed-off-by: Fam Zheng <address@hidden>
> ---
>  block.c                    | 4 +++-
>  block/raw-posix.c          | 1 -
>  block/raw-win32.c          | 1 -
>  tests/qemu-iotests/051.out | 2 +-
>  tests/qemu-iotests/069.out | 2 +-
>  5 files changed, 5 insertions(+), 5 deletions(-)

Reviewed-by: Stefan Hajnoczi <address@hidden>



reply via email to

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