Re: [PATCH v2 5/5] monitor: use aio_co_reschedule_self()

2024-05-03 Thread Kevin Wolf
Am 06.02.2024 um 20:06 hat Stefan Hajnoczi geschrieben: > The aio_co_reschedule_self() API is designed to avoid the race > condition between scheduling the coroutine in another AioContext and > yielding. > > The QMP dispatch code uses the open-coded version that appears > susceptible to the race

Re: [PULL 6/6] iotests: add backup-discard-source

2024-04-30 Thread Kevin Wolf
Am 29.04.2024 um 20:39 hat Vladimir Sementsov-Ogievskiy geschrieben: > [Add John] > > On 29.04.24 17:18, Richard Henderson wrote: > > On 4/29/24 04:51, Vladimir Sementsov-Ogievskiy wrote: > > > Add test for a new backup option: discard-source. > > > > > > Signed-off-by: Vladimir

Re: [PATCH 0/3] Make it possible to compile the x86 binaries without FDC

2024-04-29 Thread Kevin Wolf
[ Cc: qemu-block ] Am 25.04.2024 um 20:43 hat Thomas Huth geschrieben: > For downstream versions of QEMU, we'd like to be able to compile QEMU > without the FDC code included (since it's not required for modern VMs > anymore and the FDC code has rather a bad reputation, see the VENOM CVE). > >

Re: [PATCH v4] linux-aio: add IO_CMD_FDSYNC command support

2024-04-24 Thread Kevin Wolf
Am 14.03.2024 um 12:16 hat Prasad Pandit geschrieben: > From: Prasad Pandit > > Libaio defines IO_CMD_FDSYNC command to sync all outstanding > asynchronous I/O operations, by flushing out file data to the > disk storage. > > Enable linux-aio to submit such aio request. This helps to > reduce

[PATCH for-9.0?] usb-storage: Fix BlockConf defaults

2024-04-12 Thread Kevin Wolf
') Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2260 Reported-by: Jonas Svensson Signed-off-by: Kevin Wolf --- Considering this a candidate for 9.0 given that we're already having an rc4, it's a regression from 8.2 and breaks installing Windows from USB hw/usb/dev-storage-classic.c | 9

Re: [PATCH-for-9.0 v2 0/3] hw/block/nand: Fix out-of-bound access in NAND block buffer

2024-04-09 Thread Kevin Wolf
Am 09.04.2024 um 15:59 hat Philippe Mathieu-Daudé geschrieben: > Fix for https://gitlab.com/qemu-project/qemu/-/issues/1446 > > Since v1: > - Addressed Kevin trivial suggestions (unsigned offset) You already kept the Reviewed-by tags, but looks good to me. Kevin

Re: [PATCH-for-9.0? 0/3] hw/block/nand: Fix out-of-bound access in NAND block buffer

2024-04-09 Thread Kevin Wolf
t; hw/block/nand: Fix out-of-bound access in NAND block buffer As we're short on time for 9.0: Reviewed-by: Kevin Wolf But it feels to me like this device could use some more cleanup to make the code more robust. Kevin

Re: [PATCH-for-9.0? 1/3] hw/block/nand: Factor nand_load_iolen() method out

2024-04-09 Thread Kevin Wolf
Am 08.04.2024 um 10:36 hat Philippe Mathieu-Daudé geschrieben: > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/block/nand.c | 32 +++- > 1 file changed, 19 insertions(+), 13 deletions(-) > > diff --git a/hw/block/nand.c b/hw/block/nand.c > index

Re: [PATCH] block: Remove unnecessary NULL check in bdrv_pad_request()

2024-04-02 Thread Kevin Wolf
Am 02.04.2024 um 12:53 hat Philippe Mathieu-Daudé geschrieben: > On 27/3/24 20:27, Kevin Wolf wrote: > > Coverity complains that the check introduced in commit 3f934817 suggests > > that qiov could be NULL and we dereference it before reaching the check. > > In fact, all of t

Re: [PATCH v1] coroutine: avoid inserting duplicate coroutine to co_queue_wakeup

2024-03-28 Thread Kevin Wolf
Am 27.03.2024 um 23:13 hat Eric Blake geschrieben: > On Mon, Mar 25, 2024 at 11:50:41AM -0400, Stefan Hajnoczi wrote: > > On Mon, Mar 25, 2024 at 05:18:50PM +0800, zhuyangyang wrote: > > > If g_main_loop_run()/aio_poll() is called in the coroutine context, > > > the pending coroutine may be woken

[PATCH] block: Remove unnecessary NULL check in bdrv_pad_request()

2024-03-27 Thread Kevin Wolf
Coverity complains that the check introduced in commit 3f934817 suggests that qiov could be NULL and we dereference it before reaching the check. In fact, all of the callers pass a non-NULL pointer, so just remove the misleading check. Resolves: Coverity CID 1542668 Signed-off-by: Kevin Wolf

[PULL 6/6] iotests: add test for stream job with an unaligned prefetch read

2024-03-26 Thread Kevin Wolf
during iteration in bdrv_flush_all() could lead to unreferencing the wrong block driver state and an assertion failure later. Signed-off-by: Fiona Ebner Message-ID: <20240322095009.346989-5-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevi

[PULL 4/6] block-backend: fix edge case in bdrv_next() where BDS associated to BB changes

2024-03-26 Thread Kevin Wolf
cked (fn=..., job=...) > #8 job_do_finalize_locked (job=...) > #9 job_exit (opaque=...) > #10 aio_bh_poll (ctx=...) > #11 aio_poll (ctx=..., blocking=...) > #12 bdrv_poll_co (s=...) > #13 bdrv_flush (bs=...) > #14 bdrv_flush_all () > #15 do_vm_stop (state=..., send_stop=...) > #16

[PULL 3/6] block/io: accept NULL qiov in bdrv_pad_request

2024-03-26 Thread Kevin Wolf
quot;device": > "node1" } } > EOF Originally-by: Stefan Reiter Signed-off-by: Thomas Lamprecht [FE: do update bytes and offset in any case add reproducer to commit message] Signed-off-by: Fiona Ebner Message-ID: <20240322095009.346989-2-f.eb...@proxmox.com> Reviewe

[PULL 5/6] block-backend: fix edge case in bdrv_next_cleanup() where BDS associated to BB changes

2024-03-26 Thread Kevin Wolf
referenced previously anymore. Instead, rely on bdrv_next() to set it->bs to the BDS it referenced and unreference that one in any case. Signed-off-by: Fiona Ebner Message-ID: <20240322095009.346989-4-f.eb...@proxmox.com> Reviewed-by: Kevin Wolf Reviewed-by: Stefan Hajnoczi Signed

[PULL 0/6] Block layer patches

2024-03-26 Thread Kevin Wolf
in bdrv_next_cleanup() where BDS associated to BB changes iotests: add test for stream job with an unaligned prefetch read Kevin Wolf (1): vdpa-dev: Fix initialisation order to restore VDUSE compatibility Stefan Reiter (1): block/io: accept NULL qiov in bdrv_pad_request Thomas

[PULL 2/6] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-03-26 Thread Kevin Wolf
doesn't change for this device. Cc: qemu-sta...@nongnu.org Fixes: 6c4825476a43 ('vdpa: move vhost_vdpa_set_vring_ready to the caller') Signed-off-by: Kevin Wolf Message-ID: <20240315155949.86066-1-kw...@redhat.com> Reviewed-by: Eugenio Pérez Reviewed-by: Stefano Garzarella Signed-off-by:

[PULL 1/6] tests/qemu-iotests: Test 157 and 227 require virtio-blk

2024-03-26 Thread Kevin Wolf
com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/157 | 2 ++ tests/qemu-iotests/227 | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/qemu-iotests/157 b/tests/qemu-iotests/157 index 0dc9ba68d2..aa2ebbfb4b 100755 --- a/tests/qemu-iotests/157 +++ b/test

Re: [PATCH v3 0/4] fix two edge cases related to stream block jobs

2024-03-26 Thread Kevin Wolf
Am 25.03.2024 um 21:11 hat Stefan Hajnoczi geschrieben: > On Fri, Mar 22, 2024 at 10:50:05AM +0100, Fiona Ebner wrote: > > Changes in v3: > > * Also deal with edge case in bdrv_next_cleanup(). Haven't run > > into an actual issue there, but at least the caller in > >

Re: [PATCH v3 2/4] block-backend: fix edge case in bdrv_next() where BDS associated to BB changes

2024-03-26 Thread Kevin Wolf
Am 22.03.2024 um 10:50 hat Fiona Ebner geschrieben: > The old_bs variable in bdrv_next() is currently determined by looking > at the old block backend. However, if the block graph changes before > the next bdrv_next() call, it might be that the associated BDS is not > the same that was referenced

Re: [PATCH] tests/qemu-iotests: Test 157 and 227 require virtio-blk

2024-03-26 Thread Kevin Wolf
Am 25.03.2024 um 16:47 hat Thomas Huth geschrieben: > Tests 157 and 227 use the virtio-blk device, so we have to mark these > tests accordingly to be skipped if this devices is not available (e.g. > when running the tests with qemu-system-avr only). > > Signed-off-by: Thomas Huth Thanks,

Re: [PATCH for-9.0 v3] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-03-19 Thread Kevin Wolf
Am 18.03.2024 um 20:27 hat Eugenio Perez Martin geschrieben: > On Mon, Mar 18, 2024 at 10:02 AM Michael S. Tsirkin wrote: > > > > On Mon, Mar 18, 2024 at 12:31:26PM +0800, Jason Wang wrote: > > > On Fri, Mar 15, 2024 at 11:59 PM Kevin Wolf wrote: > > > > &g

[PULL 09/15] tests/qemu-iotests: Restrict test 130 to the 'file' protocol

2024-03-18 Thread Kevin Wolf
From: Thomas Huth Using "-drive ...,backing.file.filename=..." only works with the file protocol, but not with URIs, so mark this test accordingly. Signed-off-by: Thomas Huth Message-ID: <2024031508.153201-5-th...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin

[PULL 06/15] tests/qemu-iotests: Fix test 033 for running with non-file protocols

2024-03-18 Thread Kevin Wolf
viewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/033 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/033 b/tests/qemu-iotests/033 index da9133c44b..4bc7a071bd 100755 --- a/tests/qemu-iotests/033 +++ b/tests/qemu-iotests/033 @@

[PULL 02/15] nbd/server: Fix race in draining the export

2024-03-18 Thread Kevin Wolf
fd6afc501a01 ("nbd/server: Use drained block ops to quiesce the server") Signed-off-by: Kevin Wolf Message-ID: <20240314165825.40261-2-kw...@redhat.com> Signed-off-by: Kevin Wolf --- nbd/server.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a

[PULL 12/15] tests/qemu-iotests: Restrict tests that use --image-opts to the 'file' protocol

2024-03-18 Thread Kevin Wolf
: <2024031508.153201-8-th...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/188 | 2 +- tests/qemu-iotests/189 | 2 +- tests/qemu-iotests/198 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/188 b/tests/qemu-iotests/188

[PULL 10/15] tests/qemu-iotests: Restrict test 134 and 158 to the 'file' protocol

2024-03-18 Thread Kevin Wolf
Block for encryption") Signed-off-by: Thomas Huth Message-ID: <2024031508.153201-6-th...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/134 | 2 +- tests/qemu-iotests/158 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/te

[PULL 11/15] tests/qemu-iotests: Restrict test 156 to the 'file' protocol

2024-03-18 Thread Kevin Wolf
Signed-off-by: Thomas Huth Message-ID: <2024031508.153201-7-th...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/156 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/156 b/tests/qemu-iotests/156 index a9540b

[PULL 13/15] tests/qemu-iotests: Fix some tests that use --image-opts for other protocols

2024-03-18 Thread Kevin Wolf
com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/263| 6 -- tests/qemu-iotests/284| 7 +++ tests/qemu-iotests/tests/detect-zeroes-registered-buf | 4 +++- 3 files changed, 10 insertions(+), 7 de

[PULL 04/15] blockdev: Fix blockdev-snapshot-sync error reporting for no medium

2024-03-18 Thread Kevin Wolf
or": {"class": "GenericError", "desc": "Device '(null)' has no medium"}} Broken when commit 0901f67ecdb made @device optional. Use bdrv_get_device_or_node_name() instead. Now it fails as it should: <- {"error": {"class": &q

[PULL 01/15] mirror: Don't call job_pause_point() under graph lock

2024-03-18 Thread Kevin Wolf
://issues.redhat.com/browse/RHEL-28125 Fixes: 004915a96a7a ("block: Protect bs->backing with graph_lock") Signed-off-by: Kevin Wolf Message-ID: <20240313153000.33121-1-kw...@redhat.com> Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- include/qemu/job.h | 2 +- block/mirror.c | 10

[PULL 08/15] tests/qemu-iotests: Restrict test 114 to the 'file' protocol

2024-03-18 Thread Kevin Wolf
emu-build/tests/qemu-iotests/scratch/qcow2-ssh-114/t.qcow2.orig' for writing: No such file or directory Thus mark this test for "file protocol only" accordingly. Signed-off-by: Thomas Huth Message-ID: <2024031508.153201-4-th...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by:

[PULL 14/15] tests/qemu-iotests: Restrict tests using "--blockdev file" to the file protocol

2024-03-18 Thread Kevin Wolf
From: Thomas Huth Tests that use "--blockdev" with the "file" driver cannot work with other protocols, so we should mark them accordingly. Signed-off-by: Thomas Huth Message-ID: <2024031508.153201-10-th...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: K

[PULL 03/15] iotests: Add test for reset/AioContext switches with NBD exports

2024-03-18 Thread Kevin Wolf
to find a different easy way to trigger the bug, but couldn't find one. Signed-off-by: Kevin Wolf Message-ID: <20240314165825.40261-3-kw...@redhat.com> Signed-off-by: Kevin Wolf --- tests/qemu-iotests/tests/iothreads-nbd-export | 66 +++ .../tests/iothreads-nbd-expo

[PULL 15/15] iotests: adapt to output change for recently introduced 'detached header' field

2024-03-18 Thread Kevin Wolf
niel P. Berrangé Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/198.out | 2 ++ tests/qemu-iotests/206.out | 1 + 2 files changed, 3 insertions(+) diff --git a/tests/qemu-iotests/198.out b/tests/qemu-iotests/198.out index 805494916f..62fb73fa3e 100644 --- a/tests/qemu

[PULL 00/15] Block layer patches

2024-03-18 Thread Kevin Wolf
Formatting in snapshot list Fiona Ebner (1): iotests: adapt to output change for recently introduced 'detached header' field Kevin Wolf (3): mirror: Don't call job_pause_point() under graph lock nbd/server: Fix race in draining the export iotests: Add test for reset

[PULL 05/15] qemu-img: Fix Column Width and Improve Formatting in snapshot list

2024-03-18 Thread Kevin Wolf
nd 286] Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- block/qapi.c | 10 ++-- tests/qemu-iotests/176.out| 16 +++ tests/qemu-iotests/261| 4 +- tests/qemu-iotests/267.out| 48 +--

[PULL 07/15] tests/qemu-iotests: Restrict test 066 to the 'file' protocol

2024-03-18 Thread Kevin Wolf
From: Thomas Huth The hand-crafted json statement in this test only works if the test is run with the "file" protocol, so mark this test accordingly. Signed-off-by: Thomas Huth Message-ID: <2024031508.153201-3-th...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin

Re: [PATCH] iotests: adapt to output change for recently introduced 'detached header' field

2024-03-18 Thread Kevin Wolf
Am 16.02.2024 um 11:14 hat Fiona Ebner geschrieben: > Failure was noticed when running the tests for the qcow2 image format. > > Fixes: 0bd779e27e ("crypto: Introduce 'detached-header' field in > QCryptoBlockInfoLUKS") > Signed-off-by: Fiona Ebner Thanks, applied to the block branch. Kevin

Re: [PATCH 0/9] tests/qemu-iotests: Fix running with "check -ssh -qcow2"

2024-03-18 Thread Kevin Wolf
Am 15.03.2024 um 12:10 hat Thomas Huth geschrieben: > I recently wanted to check for some changes that I did to the URI handling > in the block layer code, but I had to discover that a lot of iotests only > work with the raw file format when using a protocol that is not "file", > i.e. "./check

Re: [PATCH] blockdev: Fix blockdev-snapshot-sync error reporting for no medium

2024-03-18 Thread Kevin Wolf
Am 06.03.2024 um 15:28 hat Markus Armbruster geschrieben: > When external_snapshot_abort() rejects a BlockDriverState without a > medium, it creates an error like this: > > error_setg(errp, "Device '%s' has no medium", device); > > Trouble is @device can be null. My system formats null

Re: [PATCH for-9.0] mirror: Don't call job_pause_point() under graph lock

2024-03-18 Thread Kevin Wolf
Am 14.03.2024 um 15:29 hat Stefan Hajnoczi geschrieben: > On Wed, Mar 13, 2024 at 04:30:00PM +0100, Kevin Wolf wrote: > > Calling job_pause_point() while holding the graph reader lock > > potentially results in a deadlock: bdrv_graph_wrlock() first drains > > everything, inc

[PATCH for-9.0 v3] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-03-15 Thread Kevin Wolf
doesn't change for this device. Cc: qemu-sta...@nongnu.org Fixes: 6c4825476a4351530bcac17abab72295b75ffe98 Signed-off-by: Kevin Wolf --- v2: - Actually make use of the @enable parameter - Change vhost_net to preserve the current behaviour v3: - Updated trace point [Stefano] - Fixed typo

Re: [PATCH for-9.0 v2] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-03-15 Thread Kevin Wolf
Am 15.03.2024 um 16:07 hat Stefano Garzarella geschrieben: > On Fri, Mar 15, 2024 at 03:03:31PM +0100, Kevin Wolf wrote: > > VDUSE requires that virtqueues are first enabled before the DRIVER_OK > > status flag is set; with the current API of the kernel module, it is > >

[PATCH for-9.0 v2] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-03-15 Thread Kevin Wolf
doesn't change for this device. Cc: qemu-sta...@nongnu.org Fixes: 6c4825476a4351530bcac17abab72295b75ffe98 Signed-off-by: Kevin Wolf --- v2: - Actually make use of the @enable parameter - Change vhost_net to preserve the current behaviour hw/net/vhost_net.c | 10 ++ hw/virtio/vdpa

[PATCH for-9.0 0/2] nbd: Fix server crash on reset with iothreads

2024-03-14 Thread Kevin Wolf
Kevin Wolf (2): nbd/server: Fix race in draining the export iotests: Add test for reset/AioContext switches with NBD exports nbd/server.c | 15 ++--- tests/qemu-iotests/tests/iothreads-nbd-export | 66 +++ .../tests/iothreads-nbd-export.out

[PATCH for-9.0 1/2] nbd/server: Fix race in draining the export

2024-03-14 Thread Kevin Wolf
.@nongnu.org Fixes: fd6afc501a019682d1b8468b562355a2887087bd Signed-off-by: Kevin Wolf --- nbd/server.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/nbd/server.c b/nbd/server.c index 941832f178..c3484cc1eb 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -3007,8 +3007,8 @@ stati

[PATCH for-9.0 2/2] iotests: Add test for reset/AioContext switches with NBD exports

2024-03-14 Thread Kevin Wolf
to find a different easy way to trigger the bug, but couldn't find one. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/tests/iothreads-nbd-export | 66 +++ .../tests/iothreads-nbd-export.out| 19 ++ 2 files changed, 85 insertions(+) create mode 100755 tests/qemu

[PATCH for-9.0] mirror: Don't call job_pause_point() under graph lock

2024-03-13 Thread Kevin Wolf
://issues.redhat.com/browse/RHEL-28125 Fixes: 004915a96a7a40e942ac85e6d22518cbcd283506 Signed-off-by: Kevin Wolf --- include/qemu/job.h | 2 +- block/mirror.c | 10 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/qemu/job.h b/include/qemu/job.h index 9ea98b5927..2b873f2576

Re: [PATCH for 9.0] migration: Skip only empty block devices

2024-03-13 Thread Kevin Wolf
tion. When one device is found to be empty (sectors > > == 0), the loop exits and all the remaining devices are ignored. This > > is a regression introduced when bdrv_iterate() was removed. > > > > Change that by skipping only empty devices. > > > > Cc: Marku

Re: [PATCH v2 00/10] mirror: allow switching from background to active mode

2024-03-12 Thread Kevin Wolf
Am 12.03.2024 um 14:44 hat Vladimir Sementsov-Ogievskiy geschrieben: > On 11.03.24 18:15, Vladimir Sementsov-Ogievskiy wrote: > > On 08.03.24 11:52, Kevin Wolf wrote: > > > Am 07.03.2024 um 20:42 hat Vladimir Sementsov-Ogievskiy geschrieben: > > > > On 04.0

Re: [PATCH] virtio-blk: iothread-vq-mapping coroutine pool sizing

2024-03-12 Thread Kevin Wolf
Am 11.03.2024 um 21:14 hat Stefan Hajnoczi geschrieben: > It is possible to hit the sysctl vm.max_map_count limit when the > coroutine pool size becomes large. Each coroutine requires two mappings > (one for the stack and one for the guard page). QEMU can crash with > "failed to set up stack guard

Re: [PATCH v2] linux-aio: add IO_CMD_FDSYNC command support

2024-03-12 Thread Kevin Wolf
Am 11.03.2024 um 20:36 hat Stefan Hajnoczi geschrieben: > On Mon, Mar 11, 2024 at 04:40:05PM +0100, Kevin Wolf wrote: > > Am 11.03.2024 um 14:09 hat Stefan Hajnoczi geschrieben: > > > On Mon, Mar 11, 2024 at 11:13:33AM +0530, Prasad Pandit wrote: > >

Re: [PATCH v2] linux-aio: add IO_CMD_FDSYNC command support

2024-03-11 Thread Kevin Wolf
Am 11.03.2024 um 14:09 hat Stefan Hajnoczi geschrieben: > On Mon, Mar 11, 2024 at 11:13:33AM +0530, Prasad Pandit wrote: > > From: Prasad Pandit > > > > Libaio defines IO_CMD_FDSYNC command to sync all outstanding > > asynchronous I/O operations, by flushing out file data to the > > disk

Re: [PATCH] linux-aio: add IO_CMD_FDSYNC command support

2024-03-08 Thread Kevin Wolf
Am 07.03.2024 um 18:19 hat Prasad Pandit geschrieben: > Hi, > > On Thu, 7 Mar 2024 at 19:21, Kevin Wolf wrote: > > Kernel support for this is "relatively" new, added in 2018. Should we > > fall back to the thread pool if we receive -EINVAL? > > laio_co_submi

Re: [PATCH v2 00/10] mirror: allow switching from background to active mode

2024-03-08 Thread Kevin Wolf
Am 07.03.2024 um 20:42 hat Vladimir Sementsov-Ogievskiy geschrieben: > On 04.03.24 14:09, Peter Krempa wrote: > > On Mon, Mar 04, 2024 at 11:48:54 +0100, Kevin Wolf wrote: > > > Am 28.02.2024 um 19:07 hat Vladimir Sementsov-Ogievskiy geschrieben: > > > > On 03.11.23

Re: [PATCH] linux-aio: add IO_CMD_FDSYNC command support

2024-03-07 Thread Kevin Wolf
Am 07.03.2024 um 12:47 hat Prasad Pandit geschrieben: > From: Prasad Pandit > > Libaio defines IO_CMD_FDSYNC command to sync all outstanding > asynchronous I/O operations, by flushing out file data to the > disk storage. > > Enable linux-aio to submit such aio request. This helps to > reduce

Re: [PATCH v2 00/10] mirror: allow switching from background to active mode

2024-03-04 Thread Kevin Wolf
Am 28.02.2024 um 19:07 hat Vladimir Sementsov-Ogievskiy geschrieben: > On 03.11.23 18:56, Markus Armbruster wrote: > > Kevin Wolf writes: > > > > > Am 03.11.2023 um 10:36 hat Markus Armbruster geschrieben: > > > > Vladimir Sementsov-Ogievskiy writes: > &g

Re: [PATCH v6 01/15] hw/nvme: Use pcie_sriov_num_vfs()

2024-02-20 Thread Kevin Wolf
Am 20.02.2024 um 15:29 hat Kevin Wolf geschrieben: > Am 20.02.2024 um 13:24 hat Akihiko Odaki geschrieben: > > nvme_sriov_pre_write_ctrl() used to directly inspect SR-IOV > > configurations to know the number of VFs being disabled due to SR-IOV > > configuration writes, but

Re: [PATCH v6 01/15] hw/nvme: Use pcie_sriov_num_vfs()

2024-02-20 Thread Kevin Wolf
Am 20.02.2024 um 13:24 hat Akihiko Odaki geschrieben: > nvme_sriov_pre_write_ctrl() used to directly inspect SR-IOV > configurations to know the number of VFs being disabled due to SR-IOV > configuration writes, but the logic was flawed and resulted in > out-of-bound memory access. > > It assumed

[PATCH] iotests: Make 144 deterministic again

2024-02-09 Thread Kevin Wolf
-/issues/2126 Signed-off-by: Kevin Wolf --- tests/qemu-iotests/144 | 12 +++- tests/qemu-iotests/144.out | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/144 b/tests/qemu-iotests/144 index bdcc498fa2..d284a0e442 100755 --- a/tests/qemu-iotests/

Re: [RFC/INCOMPLETE PATCH 0/8] Attempt to make qemu-img options consistent and --help working

2024-02-09 Thread Kevin Wolf
Am 07.02.2024 um 18:58 hat Michael Tokarev geschrieben: > This is an incomplete first attempt only, there's a lot left to do. > > All the options in qemu-img is a complete mess, - no, inconsistent or > incomplete syntax in documentation, many undocumented options, option > names are used

Re: [PATCH] iothread: Simplify expression in qemu_in_iothread()

2024-02-08 Thread Kevin Wolf
Am 08.02.2024 um 11:48 hat Philippe Mathieu-Daudé geschrieben: > On 8/2/24 11:16, Kevin Wolf wrote: > > 'a == b ? false : true' is a rather convoluted way of writing 'a != b'. > > Use the more obvious way to write it. > > > > Signed-off-by: Kevin Wolf > > ---

[PATCH] iothread: Simplify expression in qemu_in_iothread()

2024-02-08 Thread Kevin Wolf
'a == b ? false : true' is a rather convoluted way of writing 'a != b'. Use the more obvious way to write it. Signed-off-by: Kevin Wolf --- iothread.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/iothread.c b/iothread.c index 6c1fc8c856..e1e9e04736 100644

Re: [PULL 1/1] virtio-blk: avoid using ioeventfd state in irqfd conditional

2024-02-08 Thread Kevin Wolf
Am 08.02.2024 um 06:37 hat Michael Tokarev geschrieben: > 06.02.2024 18:31, Stefan Hajnoczi : > > Requests that complete in an IOThread use irqfd to notify the guest > > while requests that complete in the main loop thread use the traditional > > qdev irq code path. The reason for this conditional

Re: [PULL 0/1] Block patches

2024-02-07 Thread Kevin Wolf
Am 06.02.2024 um 16:31 hat Stefan Hajnoczi geschrieben: > The following changes since commit 39a6e4f87e7b75a45b08d6dc8b8b7c2954c87440: > > Merge tag 'pull-qapi-2024-02-03' of https://repo.or.cz/qemu/armbru into > staging (2024-02-03 13:31:58 +) > > are available in the Git repository at:

[PULL 07/16] scsi: Await request purging

2024-02-07 Thread Kevin Wolf
viewed-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- hw/scsi/scsi-bus.c | 30 +- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 0a2eb11c56..230313022c 100644 --- a/hw/scsi/scsi-bus.c

[PULL 06/16] block-backend: Allow concurrent context changes

2024-02-07 Thread Kevin Wolf
the assertion to that effect. In addition, because the context can be set and queried from different threads concurrently, it has to be accessed with atomic operations. Buglink: https://issues.redhat.com/browse/RHEL-19381 Suggested-by: Kevin Wolf Signed-off-by: Hanna Czenczek Message-ID

[PULL 03/16] virtio-blk: add vq_rq[] bounds check in virtio_blk_dma_restart_cb()

2024-02-07 Thread Kevin Wolf
nna Czenczek Signed-off-by: Stefan Hajnoczi Message-ID: <20240206190610.107963-4-stefa...@redhat.com> Reviewed-by: Kevin Wolf Reviewed-by: Michael S. Tsirkin Signed-off-by: Kevin Wolf --- hw/block/virtio-blk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/block/virtio-blk.c

[PULL 01/16] virtio-blk: enforce iothread-vq-mapping validation

2024-02-07 Thread Kevin Wolf
Hanna Czenczek Message-ID: <20240206190610.107963-2-stefa...@redhat.com> Reviewed-by: Kevin Wolf Reviewed-by: Michael S. Tsirkin Signed-off-by: Kevin Wolf --- hw/block/virtio-blk.c | 183 +++--- 1 file changed, 102 insertions(+), 81 deletions(-) dif

[PULL 10/16] virtio-blk: do not use C99 mixed declarations

2024-02-07 Thread Kevin Wolf
From: Stefan Hajnoczi QEMU's coding style generally forbids C99 mixed declarations. Signed-off-by: Stefan Hajnoczi Message-ID: <20240206140410.65650-1-stefa...@redhat.com> Reviewed-by: Hanna Czenczek Reviewed-by: Kevin Wolf Acked-by: Michael S. Tsirkin Signed-off-by: Kevin Wolf -

[PULL 12/16] blkio: Respect memory-alignment for bounce buffer allocations

2024-02-07 Thread Kevin Wolf
lla Signed-off-by: Kevin Wolf Message-ID: <20240131173140.42398-1-kw...@redhat.com> Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Kevin Wolf --- block/blkio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/blkio.c b/block/blkio.c index b

[PULL 05/16] monitor: use aio_co_reschedule_self()

2024-02-07 Thread Kevin Wolf
. Suggested-by: Hanna Reitz Reviewed-by: Manos Pitsidianakis Reviewed-by: Hanna Czenczek Signed-off-by: Stefan Hajnoczi Message-ID: <20240206190610.107963-6-stefa...@redhat.com> Reviewed-by: Kevin Wolf Acked-by: Markus Armbruster Reviewed-by: Michael S. Tsirkin Signed-off-by: Kevin Wolf --- qa

[PULL 09/16] iotests: give tempdir an identifying name

2024-02-07 Thread Kevin Wolf
vieved-by: Michael Tokarev Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- tests/qemu-iotests/testenv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index 3ff38f2661..588f30a4f1 100644 --- a/tests/qemu-i

[PULL 14/16] virtio: Re-enable notifications after drain

2024-02-07 Thread Kevin Wolf
the virtqueue once after attaching the notifiers. Buglink: https://issues.redhat.com/browse/RHEL-3934 Signed-off-by: Hanna Czenczek Message-ID: <20240202153158.788922-3-hre...@redhat.com> Reviewed-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- include/block/aio.

[PULL 04/16] virtio-blk: declare VirtIOBlock::rq with a type

2024-02-07 Thread Kevin Wolf
ssing type. Specify the actual type because there is no need to use void * here. Suggested-by: Hanna Czenczek Reviewed-by: Manos Pitsidianakis Reviewed-by: Hanna Czenczek Signed-off-by: Stefan Hajnoczi Message-ID: <20240206190610.107963-5-stefa...@redhat.com> Reviewed-by: Kevin Wolf Review

[PULL 13/16] virtio-scsi: Attach event vq notifier with no_poll

2024-02-07 Thread Kevin Wolf
-by: Fiona Ebner Fixes: 766aa2de0f29b657148e04599320d771c36fd126 ("virtio-scsi: implement BlockDevOps->drained_begin()") Reviewed-by: Stefan Hajnoczi Tested-by: Fiona Ebner Reviewed-by: Fiona Ebner Signed-off-by: Hanna Czenczek Message-ID: <20240202153158.788922-2-hre...@redhat.com> Reviewed-by: Stefan

[PULL 08/16] iotests: fix leak of tmpdir in dry-run mode

2024-02-07 Thread Kevin Wolf
directory. Since meson invokes 'check' 5 times on each configure run, developers /tmp was filling up with empty temporary directories. Signed-off-by: Daniel P. Berrangé Message-ID: <20240205154019.1841037-1-berra...@redhat.com> Reviewed-by: Michael Tokarev Reviewed-by: Kevin Wolf Signed-off-by:

[PULL 00/16] Block layer patches

2024-02-07 Thread Kevin Wolf
-enable notifications after drain virtio-blk: Use ioeventfd_attach in start_ioeventfd Kevin Wolf (2): scsi: Don't ignore most usb-storage properties blkio: Respect memory-alignment for bounce buffer allocations Stefan Hajnoczi (7): virtio-blk: enforce iothread-vq-mapping

[PULL 11/16] scsi: Don't ignore most usb-storage properties

2024-02-07 Thread Kevin Wolf
or discard_granularity. Buglink: https://issues.redhat.com/browse/RHEL-22375 Signed-off-by: Kevin Wolf Message-ID: <20240131130607.24117-1-kw...@redhat.com> Signed-off-by: Kevin Wolf --- include/hw/scsi/scsi.h | 5 + hw/scsi/scsi-bus.c | 33 + hw/u

[PULL 15/16] virtio-blk: Use ioeventfd_attach in start_ioeventfd

2024-02-07 Thread Kevin Wolf
tach(), so we can reuse that function. Signed-off-by: Hanna Czenczek Message-ID: <20240202153158.788922-4-hre...@redhat.com> Reviewed-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- hw/block/virtio-blk.c | 21 ++--- 1 file changed, 10 insertions(

[PULL 16/16] virtio-blk: avoid using ioeventfd state in irqfd conditional

2024-02-07 Thread Kevin Wolf
625.415386-1-stefa...@redhat.com> Reviewed-by: Kevin Wolf Signed-off-by: Kevin Wolf --- hw/block/virtio-blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 4ca5e632ea..738cb2ac36 100644 --- a/hw/block/virtio-blk.c +++ b/h

[PULL 02/16] virtio-blk: clarify that there is at least 1 virtqueue

2024-02-07 Thread Kevin Wolf
. Suggested-by: Hanna Czenczek Reviewed-by: Manos Pitsidianakis Reviewed-by: Hanna Czenczek Signed-off-by: Stefan Hajnoczi Message-ID: <20240206190610.107963-3-stefa...@redhat.com> Reviewed-by: Kevin Wolf Reviewed-by: Michael S. Tsirkin Signed-off-by: Kevin Wolf --- hw/block/virtio-bl

Re: [PATCH] virtio-blk: avoid using ioeventfd state in irqfd conditional

2024-02-07 Thread Kevin Wolf
Am 22.01.2024 um 18:26 hat Stefan Hajnoczi geschrieben: > Requests that complete in an IOThread use irqfd to notify the guest > while requests that complete in the main loop thread use the traditional > qdev irq code path. The reason for this conditional is that the irq code > path requires the

Re: [PATCH v2 0/3] virtio: Re-enable notifications after drain

2024-02-07 Thread Kevin Wolf
Am 02.02.2024 um 16:31 hat Hanna Czenczek geschrieben: > Hanna Czenczek (3): > virtio-scsi: Attach event vq notifier with no_poll > virtio: Re-enable notifications after drain > virtio-blk: Use ioeventfd_attach in start_ioeventfd > > include/block/aio.h | 7 ++- >

Re: [PATCH] virtio-blk: do not use C99 mixed declarations

2024-02-07 Thread Kevin Wolf
Am 06.02.2024 um 15:04 hat Stefan Hajnoczi geschrieben: > QEMU's coding style generally forbids C99 mixed declarations. > > Signed-off-by: Stefan Hajnoczi Thanks, applied to the block branch. Kevin

Re: [PATCH] iotests: give tempdir an identifying name

2024-02-07 Thread Kevin Wolf
Am 05.02.2024 um 16:51 hat Daniel P. Berrangé geschrieben: > If something goes wrong causing the iotests not to cleanup their > temporary directory, it is useful if the dir had an identifying > name to show what is to blame. > > Signed-off-by: Daniel P. Berrangé Thanks, applied to the block

Re: [PATCH] iotests: fix leak of tmpdir in dry-run mode

2024-02-07 Thread Kevin Wolf
Am 05.02.2024 um 16:40 hat Daniel P. Berrangé geschrieben: > Creating an instance of the 'TestEnv' class will create a temporary > directory. This dir is only deleted, however, in the __exit__ handler > invoked by a context manager. > > In dry-run mode, we don't use the TestEnv via a context

Re: [PATCH 0/2] block: Allow concurrent BB context changes

2024-02-07 Thread Kevin Wolf
Am 02.02.2024 um 15:47 hat Hanna Czenczek geschrieben: > Hi, > > Without the AioContext lock, a BB's context may kind of change at any > time (unless it has a root node, and I/O requests are pending). That > also means that its own context (BlockBackend.ctx) and that of its root > node can

Re: [PATCH v2 0/5] virtio-blk: iothread-vq-mapping cleanups

2024-02-07 Thread Kevin Wolf
Am 06.02.2024 um 20:06 hat Stefan Hajnoczi geschrieben: > v2: > - Add comment in Patch 3 explaining why bounds check assertion [Manos] > - Remove redundant nested if in Patch 1 [Hanna] > > Hanna reviewed the iothread-vq-mapping patches after they were applied to > qemu.git. This series consists

Re: [PATCH] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-02-07 Thread Kevin Wolf
Am 06.02.2024 um 17:44 hat Eugenio Perez Martin geschrieben: > On Mon, Feb 5, 2024 at 2:49 PM Kevin Wolf wrote: > > > > Am 05.02.2024 um 13:22 hat Eugenio Perez Martin geschrieben: > > > On Fri, Feb 2, 2024 at 2:25 PM Kevin Wolf wrote: > > > > > > &g

Re: [PATCH] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-02-05 Thread Kevin Wolf
Am 05.02.2024 um 13:22 hat Eugenio Perez Martin geschrieben: > On Fri, Feb 2, 2024 at 2:25 PM Kevin Wolf wrote: > > > > VDUSE requires that virtqueues are first enabled before the DRIVER_OK > > status flag is set; with the current API of the kernel module, it is >

Re: [PATCH] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-02-05 Thread Kevin Wolf
Am 02.02.2024 um 14:25 hat Kevin Wolf geschrieben: > VDUSE requires that virtqueues are first enabled before the DRIVER_OK > status flag is set; with the current API of the kernel module, it is > impossible to enable the opposite order in our block export code because > userspace is

[PATCH] vdpa-dev: Fix initialisation order to restore VDUSE compatibility

2024-02-02 Thread Kevin Wolf
.vhost_set_vring_enable for this. VDUSE devices can be used with vdpa-dev again after this fix. Cc: qemu-sta...@nongnu.org Fixes: 6c4825476a4351530bcac17abab72295b75ffe98 Signed-off-by: Kevin Wolf --- hw/virtio/vdpa-dev.c | 5 + hw/virtio/vhost-vdpa.c | 17 + 2 files changed, 18 insertions(+), 4

Re: [PULL 11/33] scsi: only access SCSIDevice->requests from one thread

2024-02-01 Thread Kevin Wolf
Am 01.02.2024 um 10:43 hat Hanna Czenczek geschrieben: > On 31.01.24 11:17, Kevin Wolf wrote: > > Am 29.01.2024 um 17:30 hat Hanna Czenczek geschrieben: > > > I don’t like using drain as a form of lock specifically against AioContext > > > changes, but maybe Stefan

[PATCH] blkio: Respect memory-alignment for bounce buffer allocations

2024-01-31 Thread Kevin Wolf
lla Signed-off-by: Kevin Wolf --- block/blkio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/blkio.c b/block/blkio.c index 0a0a6c0f5f..b989617608 100644 --- a/block/blkio.c +++ b/block/blkio.c @@ -89,6 +89,9 @@ static int blkio_resize_bounce_pool(BDRVBlkioState *s, int64_t by

[PATCH] scsi: Don't ignore most usb-storage properties

2024-01-31 Thread Kevin Wolf
or discard_granularity. Buglink: https://issues.redhat.com/browse/RHEL-22375 Signed-off-by: Kevin Wolf --- include/hw/scsi/scsi.h | 5 + hw/scsi/scsi-bus.c | 33 + hw/usb/dev-storage-classic.c | 5 + 3 files changed, 15 insertions(+), 28 deletions

Re: [PULL 11/33] scsi: only access SCSIDevice->requests from one thread

2024-01-31 Thread Kevin Wolf
Am 29.01.2024 um 17:30 hat Hanna Czenczek geschrieben: > I don’t like using drain as a form of lock specifically against AioContext > changes, but maybe Stefan is right, and we should use it in this specific > case to get just the single problem fixed.  (Though it’s not quite trivial > either. 

Re: [PATCH [repost]] block/blkio: Don't assume size_t is 64 bit

2024-01-30 Thread Kevin Wolf
Am 30.01.2024 um 11:30 hat Richard W.M. Jones geschrieben: > On Tue, Jan 30, 2024 at 09:51:59AM +0100, Kevin Wolf wrote: > > Am 29.01.2024 um 19:53 hat Richard W.M. Jones geschrieben: > > > With GCC 14 the code failed to compile on i686 (and was wrong for any &g

Re: [PATCH [repost]] block/blkio: Don't assume size_t is 64 bit

2024-01-30 Thread Kevin Wolf
Am 29.01.2024 um 19:53 hat Richard W.M. Jones geschrieben: > With GCC 14 the code failed to compile on i686 (and was wrong for any > version of GCC): > > ../block/blkio.c: In function ‘blkio_file_open’: > ../block/blkio.c:857:28: error: passing argument 3 of ‘blkio_get_uint64’ from >

  1   2   3   4   5   6   7   8   9   10   >