Re: [PULL 00/10] Block layer patches

2020-10-16 Thread Peter Maydell
On Thu, 15 Oct 2020 at 15:50, Kevin Wolf wrote: > > The following changes since commit 57c98ea9acdcef5021f5671efa6475a5794a51c4: > > Merge remote-tracking branch 'remotes/kraxel/tags/ui-20201014-pull-request' > into staging (2020-10-14 13:56:06 +0100) > > are available in the Git repository

[PATCH v3 13/13] block/qed: bdrv_qed_do_open: deal with errp

2020-10-16 Thread Vladimir Sementsov-Ogievskiy
Set errp always on failure. Generic bdrv_open_driver supports driver functions which can return negative value and forget to set errp. That's a strange thing.. Let's improve bdrv_qed_do_open to not behave this way. This allows to simplify code in bdrv_qed_co_invalidate_cache(). Signed-off-by:

[PATCH v3 10/13] block/qcow2-bitmap: return status from qcow2_store_persistent_dirty_bitmaps

2020-10-16 Thread Vladimir Sementsov-Ogievskiy
It's better to return status together with setting errp. It makes possible to avoid error propagation. While being here, put ERRP_GUARD() to fix error_prepend(errp, ...) usage inside qcow2_store_persistent_dirty_bitmaps() (see the comment above ERRP_GUARD() definition in include/qapi/error.h)

[PATCH v3 12/13] block/qcow2: simplify qcow2_co_invalidate_cache()

2020-10-16 Thread Vladimir Sementsov-Ogievskiy
qcow2_do_open correctly sets errp on each failure path. So, we can simplify code in qcow2_co_invalidate_cache() and drop explicit error propagation. Add ERRP_GUARD() as mandated by the documentation in include/qapi/error.h so that error_prepend() is actually called even if errp is _fatal.

[PATCH v3 11/13] block/qcow2: read_cache_sizes: return status value

2020-10-16 Thread Vladimir Sementsov-Ogievskiy
It's better to return status together with setting errp. It allows to reduce error propagation. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Greg Kurz Reviewed-by: Alberto Garcia --- block/qcow2.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff

[PATCH v3 09/13] block/qcow2-bitmap: improve qcow2_load_dirty_bitmaps() interface

2020-10-16 Thread Vladimir Sementsov-Ogievskiy
It's recommended for bool functions with errp to return true on success and false on failure. Non-standard interfaces don't help to understand the code. The change is also needed to reduce error propagation. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia Reviewed-by:

[PATCH v3 08/13] block/qcow2: qcow2_get_specific_info(): drop error propagation

2020-10-16 Thread Vladimir Sementsov-Ogievskiy
Don't use error propagation in qcow2_get_specific_info(). For this refactor qcow2_get_bitmap_info_list, its current interface is rather weird. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Greg Kurz Reviewed-by: Alberto Garcia --- block/qcow2.h| 4 ++--

[PATCH v3 06/13] block/mirror: drop extra error propagation in commit_active_start()

2020-10-16 Thread Vladimir Sementsov-Ogievskiy
Let's check return value of mirror_start_job to check for failure instead of local_err. Rename ret to job, as ret is usually integer variable. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Greg Kurz Reviewed-by: Alberto Garcia --- block/mirror.c | 12 +--- 1 file changed,

[PATCH v3 07/13] blockjob: return status from block_job_set_speed()

2020-10-16 Thread Vladimir Sementsov-Ogievskiy
Better to return status together with setting errp. It allows to avoid error propagation in the caller. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Greg Kurz Reviewed-by: Alberto Garcia --- include/block/blockjob.h | 2 +- blockjob.c | 18 -- 2

[PATCH v3 05/13] block: drop extra error propagation for bdrv_set_backing_hd

2020-10-16 Thread Vladimir Sementsov-Ogievskiy
bdrv_set_backing_hd now returns status, let's use it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Greg Kurz Reviewed-by: Alberto Garcia --- block.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c index 7b6818c681..a35dc80dd4 100644 ---

[PATCH v3 04/13] blockdev: fix drive_backup_prepare() missed error

2020-10-16 Thread Vladimir Sementsov-Ogievskiy
We leak local_err and don't report failure to the caller. It's definitely wrong, let's fix. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Greg Kurz Reviewed-by: Alberto Garcia --- blockdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/blockdev.c

[PATCH v3 00/13] block: deal with errp: part I

2020-10-16 Thread Vladimir Sementsov-Ogievskiy
v3: 08: update comment, add Alberto's r-b 09: update comment, add Alberto's and Greg's r-bs 10: add Alberto's r-b 12: Update commit msg, add Alberto's and Greg's r-bs 13: add Greg's r-b Vladimir Sementsov-Ogievskiy (13): block: return status from bdrv_append and friends block: use return

[PATCH v3 03/13] block: check return value of bdrv_open_child and drop error propagation

2020-10-16 Thread Vladimir Sementsov-Ogievskiy
This patch is generated by cocci script: @@ symbol bdrv_open_child, errp, local_err; expression file; @@ file = bdrv_open_child(..., -_err +errp ); - if (local_err) + if (!file) { ... - error_propagate(errp,

[PATCH v3 01/13] block: return status from bdrv_append and friends

2020-10-16 Thread Vladimir Sementsov-Ogievskiy
The recommended use of qemu error api assumes returning status together with setting errp and avoid void functions with errp parameter. Let's improve bdrv_append and some friends to reduce error-propagation overhead in further patches. Choose int return status, because bdrv_replace_node() has

[PATCH v3 02/13] block: use return status of bdrv_append()

2020-10-16 Thread Vladimir Sementsov-Ogievskiy
Now bdrv_append returns status and we can drop all the local_err things around it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Greg Kurz Reviewed-by: Alberto Garcia --- block.c | 5 + block/backup-top.c | 20 block/commit.c

Re: [PATCH v2] hw/block/nand: Decommission the NAND museum

2020-10-16 Thread Philippe Mathieu-Daudé
Cc'ing qemu-trivial@ since this patch is reviewed. On 10/15/20 8:12 PM, Philippe Mathieu-Daudé wrote: ping^2... On 10/1/20 7:31 PM, Philippe Mathieu-Daudé wrote: ping qemu-block or qemu-arm? On 9/15/20 7:16 PM, Philippe Mathieu-Daudé wrote: This is the QEMU equivalent of this Linux commit

Re: [PATCH v11 13/13] block: apply COR-filter to block-stream jobs

2020-10-16 Thread Vladimir Sementsov-Ogievskiy
15.10.2020 20:16, Andrey Shinkevich wrote: On 14.10.2020 19:24, Max Reitz wrote: On 12.10.20 19:43, Andrey Shinkevich wrote: [...] ---   block/stream.c | 93 +-   tests/qemu-iotests/030 | 51 +++--  

[libnbd PATCH] info: Add support for new 'qemu-nbd -A' qemu:allocation-depth

2020-10-16 Thread Eric Blake
A rather trivial decoding; we may enhance it further if qemu extends things to give an integer depth alongside its tri-state encoding. --- I'll wait to push this to libnbd until the counterpart qemu patches land upstream, although it looks like I've got positive review. info/nbdinfo.c | 7

Re: [PATCH v11 13/13] block: apply COR-filter to block-stream jobs

2020-10-16 Thread Andrey Shinkevich
On 15.10.2020 20:16, Andrey Shinkevich wrote: On 14.10.2020 19:24, Max Reitz wrote: On 12.10.20 19:43, Andrey Shinkevich wrote: [...] ---   block/stream.c | 93 +-   tests/qemu-iotests/030 | 51 +++--  

Re: [PATCH v11 05/13] copy-on-read: limit COR operations to base in COR driver

2020-10-16 Thread Vladimir Sementsov-Ogievskiy
15.10.2020 20:37, Andrey Shinkevich wrote: On 15.10.2020 18:56, Max Reitz wrote: On 14.10.20 20:57, Andrey Shinkevich wrote: On 14.10.2020 15:01, Max Reitz wrote: On 12.10.20 19:43, Andrey Shinkevich wrote: Limit COR operations by the base node in the backing chain when the overlay base node