qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] block: Propagate error in bdrv_img_create()
@ 2014-10-27 12:30 Max Reitz
  2014-10-27 12:30 ` [Qemu-devel] [PATCH 1/2] " Max Reitz
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Max Reitz @ 2014-10-27 12:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Peter Lieven, Stefan Hajnoczi, Max Reitz

Currently, when trying to create a backed image without specifying its
size, when the backing file does not exist or is not accessible, an
appropriate error message will be generated which is then (in
bdrv_img_create()) prefixed with the image file name and the strerror().
However, both are generally already part of the bdrv_open() error
message, so we should not double this information. An example:

$ qemu-img create -f qcow2 -b /tmp/enoent /tmp/img.qcow2
qemu-img: /tmp/img.qcow2: Could not open '/tmp/enoent': Could not open
'/tmp/enoent': No such file or directory: No such file or directory

Just propagating the error is sufficient:

$ qemu-img create -f qcow2 -b /tmp/enoent /tmp/img.qcow2
qemu-img /tmp/img.qcow2: Could not open '/tmp/enoent': No such file or
directory


Max Reitz (2):
  block: Propagate error in bdrv_img_create()
  iotests: Add test for non-existing backing file

 block.c                    |  5 -----
 tests/qemu-iotests/111     | 53 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/111.out |  3 +++
 tests/qemu-iotests/group   |  1 +
 4 files changed, 57 insertions(+), 5 deletions(-)
 create mode 100755 tests/qemu-iotests/111
 create mode 100644 tests/qemu-iotests/111.out

-- 
1.9.3

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

end of thread, other threads:[~2014-11-03 13:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-27 12:30 [Qemu-devel] [PATCH 0/2] block: Propagate error in bdrv_img_create() Max Reitz
2014-10-27 12:30 ` [Qemu-devel] [PATCH 1/2] " Max Reitz
2014-10-27 12:30 ` [Qemu-devel] [PATCH 2/2] iotests: Add test for non-existing backing file Max Reitz
2014-10-27 17:14   ` Eric Blake
2014-10-28  8:29     ` Max Reitz
2014-10-27 12:46 ` [Qemu-devel] [PATCH 0/2] block: Propagate error in bdrv_img_create() Peter Lieven
2014-10-28 12:27 ` Kevin Wolf
2014-10-29 10:42 ` Stefan Hajnoczi
2014-11-03 12:33   ` Max Reitz
2014-11-03 13:38     ` Kevin Wolf

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