This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_snapshot_fallback() need to hold a reader lock for the graph
because it accesses the children list of a node.
Signed-off-by: Kevin Wolf
Message-ID: <20230929145157.45443-8-kw...@redhat.com>
Reviewed-by: Stefan Hajnoczi
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_get_specific_info() need to hold a reader lock for the graph.
This removes an assume_graph_lock() call in vmdk's implementation.
Signed-off-by: Kevin Wolf
Message-ID: <20230929145157.45443-20-kw...@redhat.com>
Reviewed
The function reads the parents list, so it needs to hold the graph lock.
Signed-off-by: Kevin Wolf
Message-ID: <20230929145157.45443-4-kw...@redhat.com>
Reviewed-by: Stefan Hajnoczi
Signed-off-by: Kevin Wolf
---
block.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff
om the
oldest way to the next oldest one. Pointing them to the modern way makes
more sense.
> >
> > CC: Kevin Wolf
> > CC: Eric Blake
> > CC: Stefan Hajnoczi
> > CC: Hanna Czenczek
> >
> > Signed-off-by: Juan Quintela
Kevin
Am 10.10.2023 um 22:48 hat Stefan Hajnoczi geschrieben:
> On Fri, Sep 29, 2023 at 04:51:35PM +0200, Kevin Wolf wrote:
> > After all the preparation in previous series, this series reaches an
> > important milestone for the graph locking work: TSA can now verify that
> >
Am 04.09.2023 um 12:03 hat Paolo Bonzini geschrieben:
> Provide coroutine versions of bdrv_is_allocated* and bdrv_block_status*,
> since the underlying BlockDriver API is coroutine-based, and use
> automatically-generated wrappers for the "mixed" versions.
>
> v2->v3: cleaned up formatting
Thanks
Am 05.10.2023 um 21:55 hat Vladimir Sementsov-Ogievskiy geschrieben:
> On 11.09.23 12:46, 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
e
the GRAPH_RDLOCK annotations yet. In this case, add assume_graph_lock()
with a FIXME comment. These places will be removed once everything is
properly annotated.
Signed-off-by: Kevin Wolf
---
block/qcow2.h | 180 +
include/block/block-global-state.h
It still has an assume_graph_lock() call, but all of its callers are now
properly annotated to hold the graph lock. Update the function to be
GRAPH_RDLOCK as well and remove the assume_graph_lock().
Signed-off-by: Kevin Wolf
---
block/qcow2-bitmap.c | 9 +++--
1 file changed, 3 insertions
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_op_is_blocked() need to hold a reader lock for the graph
because it calls bdrv_get_device_or_node_name(), which accesses the
parents list of a node.
Signed-off-by: Kevin Wolf
---
include/block/block-global-state.h | 4
Add a new wrapper type for GRAPH_RDLOCK functions that should be called
from coroutine context.
Signed-off-by: Kevin Wolf
---
include/block/block-common.h | 7 +--
scripts/block-coroutine-wrapper.py | 10 +++---
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_amend_options() need to hold a reader lock for the graph. This
removes an assume_graph_lock() call in crypto's implementation.
Signed-off-by: Kevin Wolf
---
include/block/block-global-state.h | 8
include/
he test to use a BH to drop out of coroutine context, and add
coroutine_mixed_fn and no_coroutine_fn markers to clarify the context
each function runs in.
Signed-off-by: Kevin Wolf
---
tests/unit/test-bdrv-drain.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tests
close_data_file = true, we know that we were called from
non-coroutine main loop context (more specifically, we're coming from
qcow2_close()) and can safely drop the reader lock temporarily with
bdrv_graph_rdunlock_main_loop() and acquire the writer lock.
Signed-off-by: Kevin Wolf
---
block/
case, add assume_graph_lock()
with a FIXME comment. These places will be removed once everything is
properly annotated.
Signed-off-by: Kevin Wolf
---
block/qcow2.h| 7 +++
include/block/block-io.h | 8 ++--
include/block/block_int-io.h | 2 +-
include/block/q
ock: Mark drain related functions GRAPH_RDLOCK
Kevin Wolf (21):
test-bdrv-drain: Don't call bdrv_graph_wrlock() in coroutine context
block-coroutine-wrapper: Add no_co_wrapper_bdrv_rdlock functions
block: Take graph rdlock in bdrv_inactivate_all()
block: Mark bdrv_first_blk() a
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_snapshot_fallback() need to hold a reader lock for the graph
because it accesses the children list of a node.
Signed-off-by: Kevin Wolf
---
include/block/block_int-common.h | 18
include/block/snapshot.h
bdrv_graph_wrlock() can't run in a coroutine (because it polls) and
requires holding the BQL. We already have GLOBAL_STATE_CODE() to assert
the latter. Assert the former as well and add a no_coroutine_fn marker.
Signed-off-by: Kevin Wolf
---
include/block/graph-lock.h | 3 ++-
block/
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_get_xdbg_block_graph() need to hold a reader lock for the graph
because it accesses the children list of a node.
Signed-off-by: Kevin Wolf
---
include/block/block-global-state.h | 2 +-
blockdev.c | 2
t they will hold the lock, but we don't have
the GRAPH_RDLOCK annotations yet. In this case, add assume_graph_lock()
with a FIXME comment. These places will be removed once everything is
properly annotated.
Signed-off-by: Emanuele Giuseppe Esposito
Signed-off-by: Kevin Wolf
---
include/
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_primary_child() need to hold a reader lock for the graph
because it accesses the children list of a node.
Signed-off-by: Kevin Wolf
---
include/block/block_int-io.h | 5 +++--
block.c | 11
accessing the graph.
Signed-off-by: Kevin Wolf
---
include/block/block_int-common.h | 13 +---
block.c | 57
2 files changed, 43 insertions(+), 27 deletions(-)
diff --git a/include/block/block_int-common.h b/include/block/block_in
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_refresh_filename() need to hold a reader lock for the graph
because it accesses the children list of a node.
Signed-off-by: Kevin Wolf
---
block/vhdx.h | 5 +--
include/block/block-global-state.h | 9
Almost all functions that access the child links already take the graph
lock now. Add locking to the remaining users and finally annotate the
struct field itself as protected by the graph lock.
Signed-off-by: Kevin Wolf
---
include/block/block_int-common.h | 4 ++--
block.c
Almost all functions that access the parent link already take the graph
lock now. Add locking to the remaining user in a test case and finally
annotate the struct field itself as protected by the graph lock.
Signed-off-by: Kevin Wolf
---
include/block/block_int-common.h | 4 ++--
tests/unit
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_parent_cb_resize() need to hold a reader lock for the graph.
Signed-off-by: Kevin Wolf
---
block/io.c | 12 +---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/block/io.c b/block/io.c
index 63f248d672
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_first_blk() and bdrv_is_root_node() need to hold a reader lock
for the graph. These functions are the only functions in block-backend.c
that access the parent list of a node.
Signed-off-by: Kevin Wolf
---
include/block/block
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_get_specific_info() need to hold a reader lock for the graph.
This removes an assume_graph_lock() call in vmdk's implementation.
Signed-off-by: Kevin Wolf
---
include/block/block-io.h | 5 +++--
include/block/bloc
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_apply_auto_read_only() need to hold a reader lock for the graph
because it calls bdrv_can_set_read_only(), which indirectly accesses the
parents list of a node.
Signed-off-by: Kevin Wolf
---
include/block/block-io.h | 6
The function reads the parents list, so it needs to hold the graph lock.
Signed-off-by: Kevin Wolf
---
block.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/block.c b/block.c
index e7f349b25c..73fd386076 100644
--- a/block.c
+++ b/block.c
@@ -6975,7 +6975,8 @@ void
Am 22.09.2023 um 12:10 hat Kevin Wolf geschrieben:
> Am 21.09.2023 um 19:02 hat Andrey Drobyshev geschrieben:
> > On 9/14/23 16:34, Kevin Wolf wrote:
> > > Am 07.09.2023 um 23:02 hat Andrey Drobyshev via geschrieben:
> > >> v2 --> v3:
> > >> * Ma
Am 21.09.2023 um 19:02 hat Andrey Drobyshev geschrieben:
> On 9/14/23 16:34, Kevin Wolf wrote:
> > Am 07.09.2023 um 23:02 hat Andrey Drobyshev via geschrieben:
> >> v2 --> v3:
> >> * Make "compressed" field mandatory, not optional;
> >> *
Am 20.09.2023 um 20:31 hat Markus Armbruster geschrieben:
> Variables declared in macros can shadow other variables. Much of the
> time, this is harmless, e.g.:
>
> #define _FDT(exp) \
> do {
While there, move the local variables to function scope.
>
> Suggested-by: Kevin Wolf
> Signed-off-by: Markus Armbruster
Reviewed-by: Kevin Wolf
else rename variables.
>
> Signed-off-by: Markus Armbruster
> Reviewed-by: Stefan Hajnoczi
> Acked-by: Anthony PERARD
> Acked-by: Ilya Dryomov
Reviewed-by: Kevin Wolf
else rename variables.
>
> Signed-off-by: Markus Armbruster
> Reviewed-by: Stefan Hajnoczi
Reviewed-by: Kevin Wolf
essed data blocks
- block-backend: process I/O in the current AioContext
Andrey Drobyshev via (2):
block: add BDRV_BLOCK_COMPRESSED flag for bdrv_block_status()
qemu-img: map: report compressed data blocks
Kevi
Am 08.09.2023 um 09:54 hat Paolo Bonzini geschrieben:
> It is forbidden to block on the event loop during a coroutine, as that
> can cause deadlocks due to recursive locking.
>
> Signed-off-by: Paolo Bonzini
Thanks, applied to the block branch.
Kevin
Am 19.09.2023 um 14:57 hat John Levon geschrieben:
> On Tue, Sep 19, 2023 at 12:54:59PM +0200, Kevin Wolf wrote:
>
> > > In the meantime, we start processing the blk_drain() code, so by the time
> > > this
> > > blk_pread() actually gets handled, quiesc
Am 31.03.2023 um 18:23 hat Hanna Czenczek geschrieben:
> IDE TRIM is a BB user that wants to elevate its BB's in-flight counter
> for a "macro" operation that consists of several actual I/O operations.
> Each of those operations is individually started and awaited. It does
> this so that blk_drain
Am 18.09.2023 um 19:28 hat John Levon geschrieben:
>
> Observed with base of qemu 6.2.0, but from code inspection it looks to me like
> it's still current in upstream master. Apologies if I have missed a fix in
> this
> area.
>
> Symptom: run a UEFI-booted SATA CD Windows installer. When it hits
Am 18.09.2023 um 20:56 hat Stefan Hajnoczi geschrieben:
> Hi Kevin,
> I believe that my own commit "block-coroutine-wrapper: use
> qemu_get_current_aio_context()" breaks this test. The failure is
> non-deterministic (happens about 1 out of 4 runs).
>
> It seems the job hangs and the test times out
Am 19.09.2023 um 07:48 hat Markus Armbruster geschrieben:
> Kevin Wolf writes:
>
> > Am 31.08.2023 um 15:25 hat Markus Armbruster geschrieben:
> >> Local variables shadowing other local variables or parameters make the
> >> code needlessly hard to understand. Tr
tched to locked tran_finalize() calls
together.
Signed-off-by: Kevin Wolf
Reviewed-by: Stefan Hajnoczi
Message-ID: <20230911094620.45040-11-kw...@redhat.com>
Signed-off-by: Kevin Wolf
---
block.c| 133 +++--
block/stream.c | 20 ++
alize() must be called without the lock held. This is because
bdrv_append() also calls bdrv_attach_child_noperm(), which currently
requires to be called unlocked. Once it changes, the transaction
callbacks can be changed, too.
Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Rev
From: Stefan Hajnoczi
This patch fixes a race condition in test-bdrv-drain that is difficult
to reproduce. test-bdrv-drain sometimes fails without an error message
on the block pull request sent by Kevin Wolf on Sep 4, 2023. I was able
to reproduce it locally and found that "block-ba
s V. Lunev
Reviewed-by: Hanna Czenczek
Signed-off-by: Andrey Drobyshev
Message-ID: <20230907210226.953821-2-andrey.drobys...@virtuozzo.com>
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
include/block/block-common.h | 3 +++
block/qcow.c | 5 -
block/qcow2.c
Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
Message-ID: <20230911094620.45040-21-kw...@redhat.com>
Signed-off-by: Kevin Wolf
---
include/block/block-global-state.h | 7 ++-
block.c| 11 +++
block/blk
: blk_mig_lock() protects the data accessed by the
completion callback.
- The remaining emulated devices and exports run with
qemu_get_aio_context() == blk_get_aio_context().
Signed-off-by: Stefan Hajnoczi
Message-ID: <20230912231037.826804-4-stefa...@redhat.com>
Reviewed-by: Kevin Wolf
Reviewed-by
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 Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan
The function reads the parents list, so it needs to hold the graph lock.
Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
Message-ID: <20230911094620.45040-17-kw...@redhat.com>
Signed-off-by: Kevin Wolf
---
block.c | 6 +-
1 file chan
Don't assume specific parameter names like 'bs' or 'blk' in the
generated code, but use the actual name.
Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
Message-ID: <20230911094620.45040-8-kw...@redhat.com>
Signed-o
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() conveniently already hold the lock.
Signed-off-by: Kevin Wolf
Reviewed-by
This field has been unused since commit 72373e40fbc ('block:
bdrv_reopen_multiple: refresh permissions on updated graph').
Remove it.
Signed-off-by: Kevin Wolf
Reviewed-by: Eric Blake
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
Message-ID: <202309110946
The function reads the parents list, so it needs to hold the graph lock.
Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Message-ID: <20230911094620.45040-18-kw...@redhat.com>
Reviewed-by: Stefan Hajnoczi
Signed-off-by: Kevin Wolf
---
block.c | 2 ++
1 file chan
-off-by: Stefan Hajnoczi
Message-ID: <20230912231037.826804-6-stefa...@redhat.com>
Reviewed-by: Kevin Wolf
Reviewed-by: Eric Blake
Signed-off-by: Kevin Wolf
---
scripts/block-coroutine-wrapper.py | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/scripts/block-co
nd not
rely on the permission updates for it.
Signed-off-by: Kevin Wolf
Reviewed-by: Eric Blake
Reviewed-by: Stefan Hajnoczi
Message-ID: <20230911094620.45040-4-kw...@redhat.com>
Signed-off-by: Kevin Wolf
---
block/preallocate.c | 89 +++--
1 file chang
ff-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
Message-ID: <20230911094620.45040-20-kw...@redhat.com>
Signed-off-by: Kevin Wolf
---
include/block/block_int-global-state.h | 2 +-
block.c| 6 +++---
block/bloc
The function reads the parents list, so it needs to hold the graph lock.
Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Message-ID: <20230911094620.45040-19-kw...@redhat.com>
Reviewed-by: Stefan Hajnoczi
Signed-off-by: Kevin Wolf
---
block.c | 4
1 file chan
essed data blocks
Kevin Wolf (21):
block: Remove unused BlockReopenQueueEntry.perms_checked
preallocate: Factor out preallocate_truncate_to_real_size()
preallocate: Don't poll during permission updates
block: Take AioContext lock for bdrv_append() more consistently
b
Hajnoczi
Message-ID: <20230912231037.826804-5-stefa...@redhat.com>
Reviewed-by: Kevin Wolf
Reviewed-by: Eric Blake
Signed-off-by: Kevin Wolf
---
block/block-backend.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/block/block-backend.c b/block/block-backend.c
i
Add a new wrapper type for GRAPH_WRLOCK functions that should be called
from coroutine context.
Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
Message-ID: <20230911094620.45040-7-kw...@redhat.com>
Signed-off-by: Kevin Wolf
---
include
utput, resulting in a new "(qemu)" prompt in
the test output that was previously on a separate line and filtered out.
Signed-off-by: Kevin Wolf
Message-ID: <20230911094620.45040-6-kw...@redhat.com>
Reviewed-by: Stefan Hajnoczi
Signed-off-by: Kevin Wolf
---
include/b
ff-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
Message-ID: <20230911094620.45040-13-kw...@redhat.com>
Signed-off-by: Kevin Wolf
---
include/block/block-global-state.h | 14 --
block.c| 7 +++
blo
-2-stefa...@redhat.com>
Reviewed-by: Kevin Wolf
Reviewed-by: Eric Blake
Reviewed-by: Klaus Jensen
Signed-off-by: Kevin Wolf
---
include/block/aio.h| 1 -
include/block/block-global-state.h | 2 ++
include/block/block-io.h | 1 -
block/block-backend.c
The function reads the parents list, so it needs to hold the graph lock.
Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
Message-ID: <20230911094620.45040-14-kw...@redhat.com>
Signed-off-by: Kevin Wolf
---
include/block/block_int-co
llers down to the place where the transaction is finalised actually
have the writer lock.
Signed-off-by: Kevin Wolf
Reviewed-by: Stefan Hajnoczi
Message-ID: <20230911094620.45040-12-kw...@redhat.com>
Signed-off-by: Kevin Wolf
---
b
ff-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
Message-ID: <20230911094620.45040-9-kw...@redhat.com>
Signed-off-by: Kevin Wolf
---
block.c | 26 +++---
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/block.c b/bl
The documentation for bdrv_append() says that the caller must hold the
AioContext lock for bs_top. Change all callers to actually adhere to the
contract.
Signed-off-by: Kevin Wolf
Reviewed-by: Eric Blake
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
Message-ID
It's essentially the same code in preallocate_check_perm() and
preallocate_close(), except that the latter ignores errors.
Signed-off-by: Kevin Wolf
Reviewed-by: Eric Blake
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
Message-ID: <20230911094620.45
with GRAPH_RDLOCK_PTR.
Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
Message-ID: <20230911094620.45040-15-kw...@redhat.com>
Signed-off-by: Kevin Wolf
---
include/block/block_int-common.h | 9 ---
include/block/block_int-global-s
Am 13.09.2023 um 01:10 hat Stefan Hajnoczi geschrieben:
> v3
> - Add Patch 2 to fix a race condition in test-bdrv-drain. This was the CI
> failure that bumped this patch series from Kevin's pull request.
> - Add missing 051.pc.out file. I tried qemu-system-aarch64 to see of 051.out
> also needs
Am 31.08.2023 um 15:25 hat Markus Armbruster geschrieben:
> Local variables shadowing other local variables or parameters make the
> code needlessly hard to understand. Tracked down with -Wshadow=local.
> Clean up: delete inner declarations when they are actually redundant,
> else rename variables
onsistent(bitmap)) {
> @@ -1625,7 +1624,7 @@ bool
> qcow2_store_persistent_dirty_bitmaps(BlockDriverState *bs,
>
> /* allocate clusters and store bitmaps */
> QSIMPLEQ_FOREACH(bm, bm_list, entry) {
> -BdrvDirtyBitmap *bitmap = bm->dirty_bitmap;
> + bitmap = bm->dirty_bitmap;
>
> if (bitmap == NULL || bdrv_dirty_bitmap_readonly(bitmap)) {
> continue;
Reviewed-by: Kevin Wolf
Am 31.08.2023 um 15:25 hat Markus Armbruster geschrieben:
> Local variables shadowing other local variables or parameters make the
> code needlessly hard to understand. Tracked down with -Wshadow=local.
> Clean up: delete inner declarations when they are actually redundant,
> else rename variables
Am 14.09.2023 um 23:40 hat Andrey Drobyshev geschrieben:
> On 9/15/23 00:17, Eric Blake wrote:
> > On Fri, Sep 08, 2023 at 12:02:26AM +0300, Andrey Drobyshev wrote:
> >> Right now "qemu-img map" reports compressed blocks as containing data
> >> but having no host offset. This is not very informati
Am 07.09.2023 um 23:02 hat Andrey Drobyshev via geschrieben:
> v2 --> v3:
> * Make "compressed" field mandatory, not optional;
> * Adjust field description in qapi/block-core.json;
> * Squash patch 3 into patch 2 so that failing tests don't break bisect;
> * Update even more tests' outputs
Am 12.09.2023 um 18:49 hat Stefan Hajnoczi geschrieben:
> On Mon, Sep 11, 2023 at 11:45:59AM +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
Am 13.09.2023 um 18:31 hat Eric Blake geschrieben:
> On Wed, Sep 13, 2023 at 04:47:54PM +0100, Daniel P. Berrangé wrote:
> > On Wed, Sep 06, 2023 at 04:09:17PM +0200, Denis V. Lunev wrote:
> > > Each particular testcase could skipped intentionally and accidentally.
> > > For example the test is not
alize() must be called without the lock held. This is because
bdrv_append() also calls bdrv_attach_child_noperm(), which currently
requires to be called unlocked. Once it changes, the transaction
callbacks can be changed, too.
Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Rev
tched to locked tran_finalize() calls
together.
Signed-off-by: Kevin Wolf
Reviewed-by: Stefan Hajnoczi
---
block.c| 133 +++--
block/stream.c | 20 ++--
2 files changed, 100 insertions(+), 53 deletions(-)
diff --git a/block.c b/block.c
The function reads the parents list, so it needs to hold the graph lock.
Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
---
block.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/block.c b/block.c
index 0f7f78f8de
The function reads the parents list, so it needs to hold the graph lock.
Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
---
block.c | 4
1 file changed, 4 insertions(+)
diff --git a/block.c b/block.c
index e024a6ccec..8e589bb2e4 100644
--- a/block.c
+++ b/block.c
The function reads the parents list, so it needs to hold the graph lock.
Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
---
include/block/block_int-common.h| 6 ++---
include/block/block_int-global-state.h | 8 +++---
include
nd not
rely on the permission updates for it.
Signed-off-by: Kevin Wolf
Reviewed-by: Eric Blake
Reviewed-by: Stefan Hajnoczi
---
block/preallocate.c | 89 +++--
1 file changed, 69 insertions(+), 20 deletions(-)
diff --git a/block/preallocate.c b/block/p
ff-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
---
block.c | 26 +++---
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/block.c b/block.c
index c8ac7cfac4..61856f5c33 100644
--- a/block.c
+++ b/block.c
@@ -91,8 +91,9 @@ s
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 Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan
with GRAPH_RDLOCK_PTR.
Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
---
include/block/block_int-common.h | 9 ---
include/block/block_int-global-state.h | 4 +--
block.c| 35
The function reads the parents list, so it needs to hold the graph lock.
Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
---
block.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/block.c b/block.c
index 06d2a1b256..e024a6ccec 100644
--- a/block.c
+++ b/block.c
llers down to the place where the transaction is finalised actually
have the writer lock.
Signed-off-by: Kevin Wolf
Reviewed-by: Stefan Hajnoczi
---
block.c | 61 +
1 file changed, 44 insertions(+), 17 deletions(-)
diff --git a/block.c b/bl
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() conveniently already hold the lock.
Signed-off-by: Kevin Wolf
Reviewed-by
ff-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
---
include/block/block-global-state.h | 14 --
block.c| 7 +++
block/quorum.c | 2 ++
block/replication.c| 6 ++
tests
ff-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
---
include/block/block_int-global-state.h | 2 +-
block.c| 6 +++---
block/block-backend.c | 3 +++
blockjob.c | 2 ++
4 files chang
Add a new wrapper type for GRAPH_WRLOCK functions that should be called
from coroutine context.
Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
---
include/block/block-common.h | 4
scripts/block-coroutine-wrapper.py | 11
This field has been unused since commit 72373e40fbc ('block:
bdrv_reopen_multiple: refresh permissions on updated graph').
Remove it.
Signed-off-by: Kevin Wolf
Reviewed-by: Eric Blake
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
---
block.c | 1 -
1 file
Don't assume specific parameter names like 'bs' or 'blk' in the
generated code, but use the actual name.
Signed-off-by: Kevin Wolf
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
---
scripts/block-coroutine-wrapper.py | 7 ---
1 file ch
The documentation for bdrv_append() says that the caller must hold the
AioContext lock for bs_top. Change all callers to actually adhere to the
contract.
Signed-off-by: Kevin Wolf
Reviewed-by: Eric Blake
Reviewed-by: Emanuele Giuseppe Esposito
Reviewed-by: Stefan Hajnoczi
---
tests/unit/test
bdrv_schedule_unref()
Kevin Wolf (21):
block: Remove unused BlockReopenQueueEntry.perms_checked
preallocate: Factor out preallocate_truncate_to_real_size()
preallocate: Don't poll during permission updates
block: Take AioContext lock for bdrv_append() more consistently
block: Intr
utput, resulting in a new "(qemu)" prompt in
the test output that was previously on a separate line and filtered out.
Signed-off-by: Kevin Wolf
---
include/block/block-global-state.h | 1 +
block.c| 17 +
block/graph-lock.c | 2
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 can't call functions that take it internally.
Signed-off-by:
501 - 600 of 12525 matches
Mail list logo