Am 08.11.2013 um 04:26 hat Fam Zheng geschrieben:
> 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 <f...@redhat.com>

Thanks, applied to the block branch.

However, while this may be an improvement, it's certainly not what we'd
want the error message to look like in the final state. Consider a chain
with multiple backing files:

qemu-system-x86_64: -drive file=/tmp/d.qcow2: could not open disk image
/tmp/d.qcow2: Could not open backing file: Could not open backing file:
Could not open backing file: Could not open backing file: Could not open
'/tmp/blubber': No such file or directory

Kevin

Reply via email to