iotests case 118 already tests all relevant operations for media change
with multiple devices, however never with iothreads. This changes the
test so that the virtio-scsi tests run with an iothread.
Signed-off-by: Kevin Wolf
Message-ID: <20231013153302.39234-3-kw...@redhat.com>
Revie
Maximets
Reviewed-by: Philippe Mathieu-Daudé
Reviewed-by: Paul Durrant
Signed-off-by: Stefan Hajnoczi
Message-ID: <20230913200045.1024233-2-stefa...@redhat.com>
Reviewed-by: Michael S. Tsirkin
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
include/sysemu/block-backend-io.h
.439110-4-andrey.drobys...@virtuozzo.com>
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
qemu-img.c | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 2b2a3a86ca..e61d996e0f 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -3759,8 +3759,1
img_rebase() to make the
write requests aligned to a predefined alignment value.
Signed-off-by: Andrey Drobyshev
Reviewed-by: Eric Blake
Reviewed-by: Hanna Czenczek
Message-ID: <20230919165804.439110-5-andrey.drobys...@virtuozzo.com>
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
: <20231031135431.393137-11-f.eb...@proxmox.com>
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
.../tests/mirror-change-copy-mode | 193 ++
.../tests/mirror-change-copy-mode.out | 5 +
2 files changed, 198 insertions(+)
create mode 100755 tests/qemu-iotests/tests/
led.
In presence of an iothread, the copy_mode member is now shared between
the iothread and the main thread, so turn accesses to it atomic.
Signed-off-by: Fiona Ebner
Message-ID: <20231031135431.393137-6-f.eb...@proxmox.com>
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
e-ID: <20231019131936.414246-2-f.eb...@proxmox.com>
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
blockjob.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/blockjob.c b/blockjob.c
index 807f992b59..953dc1b6dc 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -198,7 +198,9 @@ void blo
.eb...@proxmox.com>
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
block/mirror.c | 41 ++---
1 file changed, 18 insertions(+), 23 deletions(-)
diff --git a/block/mirror.c b/block/mirror.c
index 914d723446..31da1526eb 100644
--- a/block/mirror.c
+++ b
specified as the @replaces parameter or if the
source node is a filter node.
Signed-off-by: Fiona Ebner
Message-ID: <20231019131936.414246-4-f.eb...@proxmox.com>
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
blockdev.c | 14 --
1 file changed, 12 insertions(+), 2 del
(), which is called for the
QMP commands 'blockdev-insert-medium' and 'blockdev-change-medium', to
correctly take the lock.
Cc: qemu-sta...@nongnu.org
Fixes: https://issues.redhat.com/browse/RHEL-3922
Fixes: c066e808e11a5c181b625537b6c78e0de27a4801
Signed-off-by: Ke
sirkin
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
block/io_uring.c | 6 ++
block/linux-aio.c | 4
hw/virtio/virtio.c | 13 -
util/thread-pool.c | 5 +
hw/virtio/trace-events | 1 +
5 files changed, 28 insertions(+), 1 deletion(-)
diff -
als to the cluster size. so in any case we end up aligning
to the smallest unit of allocation.
Signed-off-by: Andrey Drobyshev
Message-ID: <20230919165804.439110-6-andrey.drobys...@virtuozzo.com>
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
qemu-img.c | 74 ++
compressed.
Signed-off-by: Andrey Drobyshev
Reviewed-by: Hanna Czenczek
Message-ID: <20230919165804.439110-9-andrey.drobys...@virtuozzo.com>
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
tests/qemu-iotests/271 | 65 +++
tests/qemu-iotests/271.out | 40 +++
-Ogievskiy
Signed-off-by: Fiona Ebner
Message-ID: <20231031135431.393137-4-f.eb...@proxmox.com>
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
block/mirror.c | 17 +
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/block/mirror.c b/block/mirror.c
negotiated by the driver. Modern drivers
enable EVENT_IDX.
Reviewed-by: Eric Blake
Signed-off-by: Stefan Hajnoczi
Message-ID: <20230913200045.1024233-5-stefa...@redhat.com>
Reviewed-by: Michael S. Tsirkin
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
hw/block/dataplane/virtio-blk.
804.439110-7-andrey.drobys...@virtuozzo.com>
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
tests/qemu-iotests/024 | 60 ++
tests/qemu-iotests/024.out | 43 +
tests/qemu-iotests/271 | 66 ++
te
Message-ID: <20231031135431.393137-2-f.eb...@proxmox.com>
Reviewed-by: Kevin Wolf
Reviewed-by: Eric Blake
Signed-off-by: Kevin Wolf
---
qapi/block-core.json | 26 ++
qapi/job.json| 4 +++-
include/block/blockjob.h | 11 +++
i
y: Michael S. Tsirkin
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
include/qemu/defer-call.h | 16
include/sysemu/block-backend-io.h | 4
block/blkio.c | 1 +
block/io_uring.c | 1 +
block/linux-aio.c
driver-specific info via a new 'query' driver method
mirror: return mirror-specific information upon query
iotests: add test for changing mirror's copy_mode
Kevin Wolf (2):
block: Fix locking in media change monitor commands
iotests: Test media change wit
o.com>
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
qemu-img.c | 13 -
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/qemu-img.c b/qemu-img.c
index 585b65640f..2b2a3a86ca 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -3814,6 +3814,8 @@ static int img_rebase(
Am 14.10.2023 um 21:59 hat BALATON Zoltan geschrieben:
> On Sat, 14 Oct 2023, Michael Tokarev wrote:
> > Can't we make -drive if=none the default?
> >
> > Yes, I know current default is ide, and whole world have to use if=none
> > explicitly
> > to undo this. I think at this point we can deprecat
Hi Michael,
I didn't see this thread when you posted it, sorry for being a bit late.
Am 16.10.2023 um 13:58 hat Michael Tokarev geschrieben:
> Almost everyone mentions -blockdev as a replacement for -drive.
More specifically for -drive if=none. I honestly don't know many common
use cases for tha
Am 31.10.2023 um 14:54 hat Fiona Ebner geschrieben:
> Changes in v4:
> * add an iotest for the new functionality
> * set actively_synced to false when setting dirty bitmap in
> bdrv_mirror_top_do_write
> * add comments describing requirements for accessing copy_mode and
> ac
Am 31.10.2023 um 14:48 hat Richard W.M. Jones geschrieben:
> On Tue, Oct 31, 2023 at 02:17:56PM +0100, Kevin Wolf wrote:
> > Am 17.10.2023 um 16:01 hat Philippe Mathieu-Daudé geschrieben:
> > > Access QOM parent with the proper QOM VIRTIO_SCSI_COMMON() macro.
> > >
&g
Am 31.10.2023 um 14:48 hat Richard W.M. Jones geschrieben:
> On Tue, Oct 31, 2023 at 02:17:56PM +0100, Kevin Wolf wrote:
> > Am 17.10.2023 um 16:01 hat Philippe Mathieu-Daudé geschrieben:
> > > Access QOM parent with the proper QOM VIRTIO_SCSI_COMMON() macro.
> > >
&g
Am 13.09.2023 um 22:00 hat Stefan Hajnoczi geschrieben:
> v3:
> - Add comment pointing to API documentation in .c file [Philippe]
> - Add virtio_notify_irqfd_deferred_fn trace event [Ilya]
> - Remove outdated #include [Ilya]
> v2:
> - Rename blk_io_plug() to defer_call() and move it to util/ so the
Am 17.10.2023 um 16:01 hat Philippe Mathieu-Daudé geschrieben:
> Access QOM parent with the proper QOM VIRTIO_SCSI_COMMON() macro.
>
> Signed-off-by: Philippe Mathieu-Daudé
> ---
> hw/scsi/virtio-scsi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/scsi/virtio-scsi
Am 31.10.2023 um 12:54 hat Hanna Czenczek geschrieben:
> On 13.10.23 17:33, Kevin Wolf wrote:
> > blk_insert_bs() requires that the caller holds the AioContext lock for
> > the node to be inserted. Since commit c066e808e11, neglecting to do so
> > causes a crash when the child
Almost all functions that access bs->file 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
---
block/parallels.h| 5 +++--
block/qe
Instead of taking the writer lock internally, require callers to already
hold it when calling bdrv_replace_node(). Its callers may already want
to hold the graph lock and so wouldn't be able to call functions that
take it internally.
Signed-off-by: Kevin Wolf
---
include/block/block-g
e.
This changes block drivers that follow this pattern to take the graph
lock after opening the child node.
Signed-off-by: Kevin Wolf
---
block/blkdebug.c | 16 ++--
block/bochs.c | 4
block/cloop.c | 4
block/copy-before-write.c | 2 ++
block
ff-by: Kevin Wolf
---
include/block/block_int-global-state.h | 13 +++--
block.c| 5 +
block/block-backend.c | 2 ++
blockjob.c | 2 ++
4 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/include/
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_cow_child() need to hold a reader lock for the graph because it
accesses bs->backing.
Signed-off-by: Kevin Wolf
---
include/block/block_int-io.h | 5 +++--
block/stream.c | 2 +-
qemu-img.c |
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_chain_contains() need to hold a reader lock for the graph because
it calls bdrv_filter_or_cow_bs(), which accesses bs->file/backing.
Signed-off-by: Kevin Wolf
---
include/block/block-global-state.h | 4 ++-
bloc
It's only a single line and has a single caller. Inlining makes things
a bit easier to follow.
Signed-off-by: Kevin Wolf
---
block.c | 14 +-
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/block.c b/block.c
index d79a6f41f9..dc43e36f69 100644
--- a/block.c
nally.
Signed-off-by: Kevin Wolf
---
block.c | 68 -
1 file changed, 43 insertions(+), 25 deletions(-)
diff --git a/block.c b/block.c
index dc43e36f69..c7409cf658 100644
--- a/block.c
+++ b/block.c
@@ -5412,6 +5412,9 @@ bdrv_replace_node_n
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_filter_child() need to hold a reader lock for the graph because it
accesses bs->file/backing.
Signed-off-by: Kevin Wolf
---
include/block/block_int-io.h | 4 ++--
block.c | 4 ++--
2 files changed
Instead of taking the writer lock internally, require callers to already
hold it when calling block_job_add_bdrv(). 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:
nally.
Signed-off-by: Kevin Wolf
---
include/block/block-global-state.h | 7 ---
block.c| 4 ++--
block/stream.c | 2 ++
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/include/block/block-global-state.h
b/include/block/block-g
river is trivially possible.
Signed-off-by: Kevin Wolf
---
block/qcow2.h| 11 ++-
include/block/block_int-common.h | 17 +
block/blkdebug.c | 13 +
block/blkverify.c| 2 +-
block/copy-before-write.c
s for the coroutines to
terminate. Annotate with GRAPH_RDLOCK as well to make this clearer.
Signed-off-by: Kevin Wolf
---
block/blkverify.c | 16 +++-
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/block/blkverify.c b/block/blkverify.c
index dae9716a26..9ea2cb4cc5 100644
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_skip_implicit_filters() need to hold a reader lock for the graph
because it calls bdrv_filter_child(), which accesses bs->file/backing.
Signed-off-by: Kevin Wolf
---
include/block/block_int-global-state.h | 3 ++-
bloc
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_skip_filters() need to hold a reader lock for the graph because it
calls bdrv_filter_child(), which accesses bs->file/backing.
Signed-off-by: Kevin Wolf
---
include/block/block-global-state.h | 8 ---
include/bl
implementation and a co_wrapper instead. The new
function is marked GRAPH_RDLOCK.
As the co_wrapper now runs the function in the AioContext of the node
(as it should always have done), this is not GLOBAL_STATE_CODE() any
more.
Signed-off-by: Kevin Wolf
---
include/block/block-global-state.h | 3
no external callers.
Signed-off-by: Kevin Wolf
---
block/copy-on-read.h | 3 ++-
include/block/block-global-state.h | 11 ++-
block.c| 5 +++--
block/commit.c | 6 ++
block/copy-on-read.c |
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_filter_or_cow_bs() need to hold a reader lock for the graph because
it calls bdrv_filter_or_cow_child(), which accesses bs->file/backing.
Signed-off-by: Kevin Wolf
---
include/block/block_int-io.h | 3 ++-
bloc
This updates the qcow2 code to add GRAPH_RDLOCK annotations for all
places that read bs->file.
Signed-off-by: Kevin Wolf
---
block/qcow2.h | 48 ++-
block/qcow2-bitmap.c | 14 +++--
block/qcow2-cluster.c | 25 +++---
bl
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_filter_bs() need to hold a reader lock for the graph because
it calls bdrv_filter_child(), which accesses bs->file/backing.
Signed-off-by: Kevin Wolf
---
include/block/block-io.h | 2 +-
include/block/block_int-io.h
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_probe_blocksizes() need to hold a reader lock for the graph because
it calls bdrv_filter_bs(), which accesses bs->file/backing.
Signed-off-by: Kevin Wolf
---
include/block/block-global-state.h | 2 +-
include/block/block_
This updates the vhdx code to add GRAPH_RDLOCK annotations for all
places that read bs->file.
Signed-off-by: Kevin Wolf
---
block/vhdx.h | 9 ++---
block/vhdx-log.c | 40 ++--
block/vhdx.c | 18 +++---
3 files changed, 39 inserti
Almost all functions that access bs->backing 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 | 2 +-
bloc
This adds GRAPH_RDLOCK annotations to declare that callers of
bdrv_has_zero_init() need to hold a reader lock for the graph because
it calls bdrv_filter_bs(), which accesses bs->file/backing.
Signed-off-by: Kevin Wolf
---
include/block/block-global-state.h | 2 +-
include/block/block_
This series is pleasantly boring for the most part and results in a
GRAPH_RDLOCK_PTR annotation for bs->file and bs->backing.
Kevin Wolf (24):
block: Mark bdrv_probe_blocksizes() and callers GRAPH_RDLOCK
block: Mark bdrv_has_zero_init() and callers GRAPH_RDLOCK
block: Mark bdrv_fil
Am 25.10.2023 um 20:56 hat Andrew Cooper geschrieben:
> On 25/10/2023 7:26 pm, David Woodhouse wrote:
> > On Wed, 2023-10-25 at 13:20 -0500, Eric Blake wrote:
> >> On Wed, Oct 25, 2023 at 03:50:42PM +0100, David Woodhouse wrote:
> >>> +
> >>> +Booting Xen PV guests
> >>> +-
> >>
Am 25.10.2023 um 14:27 hat Fiona Ebner geschrieben:
> Am 23.10.23 um 13:39 schrieb Fiona Ebner:
> > Am 19.10.23 um 15:36 schrieb Kevin Wolf:
> >> Most of this series looks good to me. Apart from the comments I made in
> >> the individual patches, I would like to see i
Am 19.10.2023 um 15:19 hat Fiona Ebner geschrieben:
> The discussion leading up to this series can be found here:
> https://lists.nongnu.org/archive/html/qemu-devel/2023-09/msg00729.html
>
> Fiona Ebner (3):
> blockjob: drop AioContext lock before calling bdrv_graph_wrlock()
> block: avoid dea
Am 23.10.2023 um 16:14 hat Fiona Ebner geschrieben:
> Am 23.10.23 um 14:59 schrieb Kevin Wolf:
> > Am 23.10.2023 um 13:37 hat Fiona Ebner geschrieben:
> >>>> +current = qatomic_cmpxchg(&s->copy_mode,
> >>>> MIRROR_COPY_MODE_BACKGROUND,
>
Am 23.10.2023 um 11:30 hat Igor Mammedov geschrieben:
> On Wed, 18 Oct 2023 09:32:47 +0100
> David Woodhouse wrote:
>
> > On Wed, 2023-10-18 at 09:32 +0200, Igor Mammedov wrote:
> > > On Mon, 16 Oct 2023 16:19:08 +0100
> > > David Woodhouse wrote:
> > >
> > > > From: David Woodhouse
> > > >
Am 23.10.2023 um 11:31 hat Fiona Ebner geschrieben:
> Am 18.10.23 um 17:52 schrieb Kevin Wolf:
> > Am 13.10.2023 um 11:21 hat Fiona Ebner geschrieben:
> >> which will allow changing job-type-specific options after job
> >> creation.
> >>
> >> In the
Am 23.10.2023 um 13:37 hat Fiona Ebner geschrieben:
> Am 18.10.23 um 18:59 schrieb Kevin Wolf:
> > Am 13.10.2023 um 11:21 hat Fiona Ebner geschrieben:
> >> which allows switching the @copy-mode from 'background' to
> >> 'write-blocking'.
> >
Am 13.10.2023 um 11:21 hat Fiona Ebner geschrieben:
> Changes in v3:
> * unlock the job mutex when calling the new block job driver
> 'query' handler
> * squash patch adapting iotest output into patch that changes the
> output
> * turn accesses to copy_mode and actively_sync
Am 18.10.2023 um 12:52 hat David Woodhouse geschrieben:
> > Actually, how does this play together with xen_config_dev_blk()? This
> > looks like it tried to implement a very similar thing (which is IF_XEN
> > even already existed).
>
> Ah yes, thanks for spotting that! I hadn't been looking at the
Am 18.10.2023 um 11:42 hat Fiona Ebner geschrieben:
> Am 17.10.23 um 16:20 schrieb Kevin Wolf:
> > Am 17.10.2023 um 15:37 hat Fiona Ebner geschrieben:
> >> Am 17.10.23 um 14:12 schrieb Kevin Wolf:
> >>> Am 17.10.2023 um 12:18 hat Fiona Ebner geschrieben:
> >&g
Am 13.10.2023 um 11:21 hat Fiona Ebner geschrieben:
> which allows switching the @copy-mode from 'background' to
> 'write-blocking'.
>
> This is useful for management applications, so they can start out in
> background mode to avoid limiting guest write speed and switch to
> active mode when certa
Am 13.10.2023 um 11:21 hat Fiona Ebner geschrieben:
> which will allow changing job-type-specific options after job
> creation.
>
> In the JobVerbTable, the same allow bits as for set-speed are used,
> because set-speed can be considered an existing change command.
>
> Signed-off-by: Fiona Ebner
Am 16.10.2023 um 17:19 hat David Woodhouse geschrieben:
> From: David Woodhouse
>
> There's no need to force the user to assign a vdev. We can automatically
> assign one, starting at xvda and searching until we find the first disk
> name that's unused.
>
> This means we can now allow '-drive if=
Am 19.09.2023 um 18:57 hat Andrey Drobyshev geschrieben:
> v2 --> v3:
> * Patch 3/8: fixed logic in the if statement, so that we align on blk
>when blk_old_backing == NULL;
> * Patch 4/8: comment fix;
> * Patch 5/8: comment fix; dropped redundant "if (blk_new_backing)"
>statements.
>
>
Am 19.09.2023 um 18:58 hat Andrey Drobyshev geschrieben:
> Add @chsize param to the function which, if non-zero, would represent
> the chunk size to be used for comparison. If it's zero, then
> BDRV_SECTOR_SIZE is used as default chunk size, which is the previous
> behaviour.
>
> In particular, w
Am 17.10.2023 um 15:37 hat Fiona Ebner geschrieben:
> Am 17.10.23 um 14:12 schrieb Kevin Wolf:
> > Am 17.10.2023 um 12:18 hat Fiona Ebner geschrieben:
> >> I ran into similar issues now with mirror, (both deadlocks and stuck
> >> guest IO at other times), and interesti
Am 17.10.2023 um 12:18 hat Fiona Ebner geschrieben:
> Am 06.10.23 um 14:18 schrieb Fiona Ebner:
> > Am 04.10.23 um 19:08 schrieb Vladimir Sementsov-Ogievskiy:
> >> On 28.09.23 11:06, Fiona Ebner wrote:
> >>> For fixing the backup cancel deadlock, I tried the following:
> >>>
> diff --git a/blo
Find an unoccupied device name */
> +while (disk < (1 << 20)) {
I like your optimism that we can handle a million disks. :-)
I haven't reviewed the Xen part in detail, but the patch looks fine on
the block layer side.
Acked-by: Kevin Wolf
Am 17.10.2023 um 11:01 hat Fiona Ebner geschrieben:
> Am 16.10.23 um 21:40 schrieb Stefan Hajnoczi:
> > diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
> > index 39e7f23fab..c2d59389cb 100644
> > --- a/hw/block/virtio-blk.c
> > +++ b/hw/block/virtio-blk.c
> > @@ -1166,7 +1166,7 @@ static
Am 17.10.2023 um 07:19 hat Michael Tokarev geschrieben:
> 05.09.2023 17:50, Kevin Wolf wrote:
> > virtio_load() as a whole should run in coroutine context because it
> > reads from the migration stream and we don't want this to block.
> >
> > However, it calls v
(), which is called for the
QMP commands 'blockdev-insert-medium' and 'blockdev-change-medium', to
correctly take the lock.
Cc: qemu-sta...@nongnu.org
Fixes: https://issues.redhat.com/browse/RHEL-3922
Fixes: c066e808e11a5c181b625537b6c78e0de27a4801
Signed-off-by: Kevin Wolf
---
blo
iotests case 118 already tests all relevant operations for media change
with multiple devices, however never with iothreads. This changes the
test so that the virtio-scsi tests run with an iothread.
Signed-off-by: Kevin Wolf
---
tests/qemu-iotests/118 | 6 --
1 file changed, 4 insertions
Kevin Wolf (2):
block: Fix locking in media change monitor commands
iotests: Test media change with iothreads
block/qapi-sysemu.c| 5 +
tests/qemu-iotests/118 | 6 --
2 files changed, 9 insertions(+), 2 deletions(-)
--
2.41.0
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
Message-ID: <20230929145157.45443-7-kw...@redhat.com>
Reviewed-by: Stefan Hajnoczi
Signed-off-by: Kevin Wolf
---
block/io.
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
Message-ID: <20230929145157.45443-10-kw...@redhat.com>
Reviewed-by: Stefan Ha
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
Message-ID: <2
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
Message-ID: <20230929145157.45443-11-kw...@redhat.com>
Reviewed-by: Stefan Hajnoczi
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
Message-ID: <20230929145157.45443-21-kw...@redhat.
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
Message-ID: <20230929145157.45443-2-kw...@redhat.com>
Reviewed-by: Stefan Hajnoczi
Signed-off-by: Kevin Wolf
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
Message-ID
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
Message-ID: <20230929145157.45443-15-kw...@redhat.com>
Reviewed-by: Stefan Hajnoczi
Signed-off-by: Kevin Wolf
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
Message-ID: <20230929145157.45443-12-kw...@redhat.com>
Reviewed-by: Stefan Hajnoczi
Sign
From: Paolo Bonzini
Include both coroutine and non-coroutine versions, the latter being
co_wrapper_mixed_bdrv_rdlock of the former.
Reviewed-by: Eric Blake
Signed-off-by: Paolo Bonzini
Message-ID: <20230904100306.156197-3-pbonz...@redhat.com>
Reviewed-by: Kevin Wolf
Signed-off-by: Kevi
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
Message-ID: <20230929145157.45443-22-kw...@redhat.com>
Reviewed-by:
: <20230904100306.156197-2-pbonz...@redhat.com>
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
block/io.c | 21 +++--
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/block/io.c b/block/io.c
index e7f9448d5a..2ff4ffda1c 100644
--- a/block/io.c
+++ b/block/io.c
@@ -
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
Message-ID: <20230929145157.45443-23-kw...@re
accessing the graph.
Signed-off-by: Kevin Wolf
Message-ID: <20230929145157.45443-9-kw...@redhat.com>
Reviewed-by: Stefan Hajnoczi
Signed-off-by: Kevin Wolf
---
include/block/block_int-common.h | 13 +---
block.c | 57
2 f
From: Paolo Bonzini
Reviewed-by: Eric Blake
Signed-off-by: Paolo Bonzini
Message-ID: <20230904100306.156197-5-pbonz...@redhat.com>
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
block/copy-before-write.c | 2 +-
block/copy-on-read.c | 8
block/io.c
}*
- Graph locking part 5 (protect children/parent links)
Emanuele Giuseppe Esposito (1):
block: Mark drain related functions GRAPH_RDLOCK
Kevin Wolf (21):
test-bdrv-drain: Don't call bdrv_graph_wrlock() in co
case, add assume_graph_lock()
with a FIXME comment. These places will be removed once everything is
properly annotated.
Signed-off-by: Kevin Wolf
Message-ID: <20230929145157.45443-13-kw...@redhat.com>
Reviewed-by: Stefan Hajnoczi
Signed-off-by: Kevin Wolf
---
block/qcow2.h
From: Paolo Bonzini
Reviewed-by: Eric Blake
Signed-off-by: Paolo Bonzini
Message-ID: <20230904100306.156197-4-pbonz...@redhat.com>
Reviewed-by: Kevin Wolf
Signed-off-by: Kevin Wolf
---
include/block/block-io.h | 12 +
block/io.c
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
Messa
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
Message-ID: <20230929145157.45443-18-kw...@redhat.
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
Message-ID: <20230929145157.45443-14-kw...@redhat.com>
Reviewed
Add a new wrapper type for GRAPH_RDLOCK functions that should be called
from coroutine context.
Signed-off-by: Kevin Wolf
Message-ID: <20230929145157.45443-3-kw...@redhat.com>
Reviewed-by: Stefan Hajnoczi
Signed-off-by: Kevin Wolf
---
include/block/block-common.h | 7 +--
s
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
Message-ID: <20230929145157.45443-17-kw...@redhat.com>
Revie
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
Message-ID: <20230929145157.45443-19
401 - 500 of 12525 matches
Mail list logo