Re: [PATCH v2 0/3] block: align CoR requests to subclusters

2023-08-22 Thread John Snow
On Tue, Aug 22, 2023 at 1:33 PM Andrey Drobyshev wrote: > > On 8/16/23 12:22, Andrey Drobyshev wrote: > > On 7/31/23 17:51, Andrey Drobyshev wrote: > >> On 7/24/23 16:11, Andrey Drobyshev wrote: > >>> On 7/11/23 20:25, Andrey Drobyshev wrote: > v1 --> v2: > * Fixed line indentation; >

Re: [PATCH v2 4/4] iotests: test the zoned format feature for qcow2 file

2023-08-22 Thread Stefan Hajnoczi
On Mon, Aug 14, 2023 at 04:58:02PM +0800, Sam Li wrote: > The zoned format feature can be tested by: > $ tests/qemu-iotests/check zoned-qcow2 > > Signed-off-by: Sam Li > --- > tests/qemu-iotests/tests/zoned-qcow2 | 135 ++ > tests/qemu-iotests/tests/zoned-qcow2.out | 140

Re: [PATCH v2 3/4] qcow2: add zoned emulation capability

2023-08-22 Thread Stefan Hajnoczi
On Mon, Aug 14, 2023 at 04:58:01PM +0800, Sam Li wrote: > By adding zone operations and zoned metadata, the zoned emulation > capability enables full emulation support of zoned device using > a qcow2 file. The zoned device metadata includes zone type, > zoned device state and write pointer of each

Re: [PATCH 21/21] block: Mark bdrv_add/del_child() and caller GRAPH_WRLOCK

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:20PM +0200, Kevin Wolf wrote: > The functions read the parents list in the generic block layer, so we > need to hold the graph lock already there. The BlockDriver > implementations actually modify the graph, so it has to be a writer > lock. > > Signed-off-by: Kevin

Re: [PATCH 20/21] block: Mark bdrv_unref_child() GRAPH_WRLOCK

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:19PM +0200, Kevin Wolf wrote: > Instead of taking the writer lock internally, require callers to already > hold it when calling bdrv_unref_child(). These callers will typically > already hold the graph lock once the locking work is completed, which > means that they

Re: [PATCH 19/21] block: Mark bdrv_root_unref_child() GRAPH_WRLOCK

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:18PM +0200, Kevin Wolf wrote: > Instead of taking the writer lock internally, require callers to already > hold it when calling bdrv_root_unref_child(). These callers will > typically already hold the graph lock once the locking work is > completed, which means that

Re: [PATCH 17/21] block: Take graph rdlock in bdrv_drop_intermediate()

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:16PM +0200, Kevin Wolf wrote: > The function reads the parents list, so it needs to hold the graph lock. > > Signed-off-by: Kevin Wolf > --- > block.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/block.c b/block.c > index 7df8780d6e..a82389f742

Re: [PATCH 16/21] block: Mark bdrv_parent_cb_change_media() GRAPH_RDLOCK

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:15PM +0200, Kevin Wolf wrote: > The function reads the parents list, so it needs to hold the graph lock. > > Signed-off-by: Kevin Wolf > --- > block.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) Reviewed-by: Stefan Hajnoczi signature.asc

Re: [PATCH 15/21] block: Mark bdrv_child_perm() GRAPH_RDLOCK

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:14PM +0200, Kevin Wolf wrote: > This adds GRAPH_RDLOCK annotations to declare that callers of > bdrv_child_perm() need to hold a reader lock for the graph because > some implementations access the children list of a node. > > The callers of bdrv_child_perm()

Re: [PATCH 14/21] block: Mark bdrv_get_cumulative_perm() and callers GRAPH_RDLOCK

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:13PM +0200, Kevin Wolf wrote: > The function reads the parents list, so it needs to hold the graph lock. > > This happens to result in BlockDriver.bdrv_set_perm() to be called with > the graph lock held. For consistency, make it the same for all of the > BlockDriver

Re: [PATCH 13/21] block: Mark bdrv_parent_perms_conflict() and callers GRAPH_RDLOCK

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:12PM +0200, Kevin Wolf wrote: > The function reads the parents list, so it needs to hold the graph lock. > > Signed-off-by: Kevin Wolf > --- > include/block/block_int-common.h| 6 ++--- > include/block/block_int-global-state.h | 8 +++--- >

Re: [PATCH 12/21] block: Mark bdrv_attach_child() GRAPH_WRLOCK

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:11PM +0200, Kevin Wolf wrote: > Instead of taking the writer lock internally, require callers to already > hold it when calling bdrv_attach_child_common(). These callers will > typically already hold the graph lock once the locking work is > completed, which means

Re: [PATCH 11/21] block: Call transaction callbacks with lock held

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:10PM +0200, Kevin Wolf wrote: > In previous patches, we changed some transactionable functions to be > marked as GRAPH_WRLOCK, but required that tran_finalize() is still > called without the lock. This was because all callbacks that can be in > the same transaction

Re: [PATCH 10/21] block: Mark bdrv_attach_child_common() GRAPH_WRLOCK

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:09PM +0200, Kevin Wolf wrote: > Instead of taking the writer lock internally, require callers to already > hold it when calling bdrv_attach_child_common(). These callers will > typically already hold the graph lock once the locking work is > completed, which means

Re: [PATCH 09/21] block: Mark bdrv_replace_child_tran() GRAPH_WRLOCK

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:08PM +0200, Kevin Wolf wrote: > Instead of taking the writer lock internally, require callers to already > hold it when calling bdrv_replace_child_tran(). These callers will > typically already hold the graph lock once the locking work is > completed, which means that

Re: [PATCH 08/21] block: Mark bdrv_replace_child_noperm() GRAPH_WRLOCK

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:07PM +0200, Kevin Wolf wrote: > Instead of taking the writer lock internally, require callers to already > hold it when calling bdrv_replace_child_noperm(). These callers will > typically already hold the graph lock once the locking work is > completed, which means

Re: [PATCH 07/21] block-coroutine-wrapper: Allow arbitrary parameter names

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:06PM +0200, Kevin Wolf wrote: > Don't assume specific parameter names like 'bs' or 'blk' in the > generated code, but use the actual name. > > Signed-off-by: Kevin Wolf > --- > scripts/block-coroutine-wrapper.py | 7 --- > 1 file changed, 4 insertions(+), 3

Re: [PATCH 06/21] block-coroutine-wrapper: Add no_co_wrapper_bdrv_wrlock functions

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:05PM +0200, Kevin Wolf wrote: > Add a new wrapper type for GRAPH_WRLOCK functions that should be called > from coroutine context. > > Signed-off-by: Kevin Wolf > --- > include/block/block-common.h | 4 > scripts/block-coroutine-wrapper.py | 11

Re: [PATCH 05/21] block: Introduce bdrv_schedule_unref()

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:04PM +0200, Kevin Wolf wrote: > bdrv_unref() is called by a lot of places that need to hold the graph > lock (it naturally happens in the context of operations that change the > graph). However, bdrv_unref() takes the graph writer lock internally, so > it can't

Re: [PATCH 04/21] block: Take AioContext lock for bdrv_append() more consistently

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:03PM +0200, Kevin Wolf wrote: > diff --git a/tests/unit/test-block-iothread.c > b/tests/unit/test-block-iothread.c > index d727a5fee8..9155547313 100644 > --- a/tests/unit/test-block-iothread.c > +++ b/tests/unit/test-block-iothread.c > @@ -756,11 +756,14 @@ static

Re: [PATCH 03/21] preallocate: Don't poll during permission updates

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:02PM +0200, Kevin Wolf wrote: > When the permission related BlockDriver callbacks are called, we are in > the middle of an operation traversing the block graph. Polling in such a > place is a very bad idea because the graph could change in unexpected > ways. In the

Re: [PATCH 02/21] preallocate: Factor out preallocate_truncate_to_real_size()

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:01PM +0200, Kevin Wolf wrote: > It's essentially the same code in preallocate_check_perm() and > preallocate_close(), except that the latter ignores errors. > > Signed-off-by: Kevin Wolf > --- > block/preallocate.c | 48 +

Re: [PATCH 01/21] block: Remove unused BlockReopenQueueEntry.perms_checked

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:50:00PM +0200, Kevin Wolf wrote: > This field has been unused since commit 72373e40fbc ('block: > bdrv_reopen_multiple: refresh permissions on updated graph'). > Remove it. > > Signed-off-by: Kevin Wolf > --- > block.c | 1 - > 1 file changed, 1 deletion(-)

Re: [PATCH 00/21] Graph locking part 4 (node management)

2023-08-22 Thread Stefan Hajnoczi
On Thu, Aug 17, 2023 at 02:49:59PM +0200, Kevin Wolf wrote: > The previous parts of the graph locking changes focussed mostly on the > BlockDriver side and taking reader locks while performing I/O. This > series focusses more on the functions managing the graph structure, i.e > adding, removing

Re: [PATCH v2 0/3] qemu-img: map: implement support for compressed clusters

2023-08-22 Thread Andrey Drobyshev
On 8/16/23 12:22, Andrey Drobyshev wrote: > On 7/31/23 17:45, Andrey Drobyshev wrote: >> On 7/24/23 16:10, Andrey Drobyshev wrote: >>> On 7/6/23 19:30, Andrey Drobyshev wrote: v1 --> v2: * Add vmdk format to the 1st commit. Tweak commit message accordingly; * Make "compressed"

Re: [PATCH 0/6] qemu-img: rebase: add compression support

2023-08-22 Thread Andrey Drobyshev
On 8/16/23 12:22, Andrey Drobyshev wrote: > On 7/31/23 17:43, Andrey Drobyshev wrote: >> On 7/24/23 16:11, Andrey Drobyshev wrote: >>> On 6/30/23 13:54, Denis V. Lunev wrote: On 6/1/23 21:28, Andrey Drobyshev wrote: > This series is adding [-c | --compress] option to "qemu-img rebase"

Re: [PATCH v2 0/3] block: align CoR requests to subclusters

2023-08-22 Thread Andrey Drobyshev
On 8/16/23 12:22, Andrey Drobyshev wrote: > On 7/31/23 17:51, Andrey Drobyshev wrote: >> On 7/24/23 16:11, Andrey Drobyshev wrote: >>> On 7/11/23 20:25, Andrey Drobyshev wrote: v1 --> v2: * Fixed line indentation; * Fixed wording in a comment; * Added R-b. v1:

Re: [PATCH 10/12] hw/vmapple/cfg: Introduce vmapple cfg region

2023-08-22 Thread Alexander Graf
On 16.06.23 12:47, Philippe Mathieu-Daudé wrote: On 15/6/23 00:57, Alexander Graf wrote: Instead of device tree or other more standardized means, VMApple passes platform configuration to the first stage boot loader in a binary encoded format that resides at a dedicated RAM region in

Re: [PATCH 09/12] hw/vmapple/bdif: Introduce vmapple backdoor interface

2023-08-22 Thread Alexander Graf
On 16.06.23 12:39, Philippe Mathieu-Daudé wrote: On 15/6/23 00:56, Alexander Graf wrote: The VMApple machine exposes AUX and ROOT block devices (as well as USB OTG emulation) via virtio-pci as well as a special, simple backdoor platform device. This patch implements this backdoor platform

Re: [PATCH v2 00/10] block: Make raw_co_get_allocated_file_size asynchronous

2023-08-22 Thread Claudio Fontana
Hi all, we currently have to maintain something downstream for this, since the current behavior can compound problems on top of existing bad NFS latency, could someone continue to help reviewing this work? Thanks, Claudio On 6/9/23 22:19, Fabiano Rosas wrote: > Hi, > > The major change from