[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v3 0/6] block: Error parameter for opening/creating im
From: |
Max Reitz |
Subject: |
[Qemu-devel] [RFC v3 0/6] block: Error parameter for opening/creating images |
Date: |
Fri, 6 Sep 2013 17:52:29 +0200 |
This RFC adds an Error ** parameter to bdrv_open, bdrv_file_open,
bdrv_create and the respective functions provided by a block driver.
This results in more specific error information than just -errno provided
to the user when opening or creating images (disregarding the fact that
block drivers often already use error_report, which is generally changed
to error_setg through this patch).
The sixth patch in this series changes the qcow2 block driver to set an
example of usage in a block driver.
Note that several I/O tests break by applying this RFC since they expect
different error messages (generally, previously, an error message on
image opening/creation consisted of two lines; the first of which would be
generated by the driver through error_report, the second by the block
layer itself through strerror(-ret); this patch is designed to merge these
two lines into a single one). This applies to the tests 49, 51, 54 and 60.
v3:
- merged old patch 6 into 3/4
- extracted new patch 5 from 3 (independent change)
- (=> old patch 5 is new patch 6)
- fixed (some?) mistakes
- wrong function calls due to the newly added parameters (some remained
unchanged in v2, others were changed too early)
- removed unintended changes in new patch 6
- added neglected qerror_report_err in old patch 6 (now in patch 3)
- took care of NULL filename in patch 3
- retained some old error messages in patch 4
v2:
- included all block drivers
- split open/create patches (old 1 into 1/2 and old 2 into 3/4)
- added a patch (6) for printing out error messages from blk_open,
blk_file_open and blk_create in all block drivers (except qcow2, for
which there is a dedicated patch (5))
I intentionally made this an own commit since I think this to be
real functionality, whereas the patches 3 and 4 are more for
introducing Error into block.c and making sure everything compiles
with these changes (without actually adding functionality to any
other code). However, I'm well aware that this in some way breaks
the code between patches 3/4 and 6, since some error messages may be
discarded between these commits. Therefore I wouldn't object too much
to merging patch 6 with 3/4.
Max Reitz (6):
bdrv: Use "Error" for opening images
bdrv: Use "Error" for creating images
block: Error parameter for open functions
block: Error parameter for create functions
qemu-img create: Emit filename on error
qcow2: Use Error parameter
block.c | 176 +++++++++++++++++++++++++++++++---------------
block/blkdebug.c | 7 +-
block/blkverify.c | 11 ++-
block/bochs.c | 3 +-
block/cloop.c | 3 +-
block/cow.c | 15 ++--
block/curl.c | 3 +-
block/dmg.c | 3 +-
block/gluster.c | 4 +-
block/iscsi.c | 8 ++-
block/mirror.c | 5 +-
block/nbd.c | 3 +-
block/parallels.c | 3 +-
block/qcow.c | 15 ++--
block/qcow2.c | 142 ++++++++++++++++++++++++-------------
block/qed.c | 18 +++--
block/raw-posix.c | 18 +++--
block/raw-win32.c | 9 ++-
block/raw_bsd.c | 16 ++++-
block/rbd.c | 6 +-
block/sheepdog.c | 16 +++--
block/snapshot.c | 2 +-
block/ssh.c | 6 +-
block/vdi.c | 6 +-
block/vhdx.c | 3 +-
block/vmdk.c | 17 +++--
block/vpc.c | 6 +-
block/vvfat.c | 13 +++-
blockdev.c | 30 ++++----
hw/block/xen_disk.c | 7 +-
include/block/block.h | 11 +--
include/block/block_int.h | 9 ++-
qemu-img.c | 39 +++++-----
qemu-io.c | 14 ++--
qemu-nbd.c | 6 +-
35 files changed, 431 insertions(+), 222 deletions(-)
--
1.8.4
- [Qemu-devel] [RFC v3 0/6] block: Error parameter for opening/creating images,
Max Reitz <=
- [Qemu-devel] [RFC v3 1/6] bdrv: Use "Error" for opening images, Max Reitz, 2013/09/06
- [Qemu-devel] [RFC v3 2/6] bdrv: Use "Error" for creating images, Max Reitz, 2013/09/06
- [Qemu-devel] [RFC v3 3/6] block: Error parameter for open functions, Max Reitz, 2013/09/06
- [Qemu-devel] [RFC v3 4/6] block: Error parameter for create functions, Max Reitz, 2013/09/06
- [Qemu-devel] [RFC v3 5/6] qemu-img create: Emit filename on error, Max Reitz, 2013/09/06
- [Qemu-devel] [RFC v3 6/6] qcow2: Use Error parameter, Max Reitz, 2013/09/06
- Re: [Qemu-devel] [RFC v3 0/6] block: Error parameter for opening/creating images, Kevin Wolf, 2013/09/10