[PATCH v2 7/7] iotests/281: Let NBD connection yield in iothread

2022-02-04 Thread Hanna Reitz
B/s, and the NBD client reads 128 kB, so it should yield at some point. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Hanna Reitz --- tests/qemu-iotests/281 | 28 +--- tests/qemu-iotests/281.out | 4 ++-- 2 files changed, 27 insertions(+), 5 deletions(-)

[PATCH v2 6/7] block/nbd: Move s->ioc on AioContext change

2022-02-04 Thread Hanna Reitz
s->ioc must always be attached to the NBD node's AioContext. If that context changes, s->ioc must be attached to the new context. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2033626 Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Hanna Reitz --- block/nbd.

[PATCH v2 2/7] block/nbd: Delete open timer when done

2022-02-04 Thread Hanna Reitz
(), and just like the reconnect delay timer, it might well be dangerous if it were to fire afterwards. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Hanna Reitz --- block/nbd.c | 8 1 file changed, 8 insertions(+) diff --git a/block/nbd.c b/block/nbd.c index 16cd7fef77..5ff8a57314

[PATCH v2 3/7] block/nbd: Assert there are no timers when closed

2022-02-04 Thread Hanna Reitz
exposes the bug. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Hanna Reitz --- block/nbd.c | 4 1 file changed, 4 insertions(+) diff --git a/block/nbd.c b/block/nbd.c index 5ff8a57314..dc6c3f3bbc 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -110,6 +110,10 @@ static void

[PATCH v2 4/7] iotests.py: Add QemuStorageDaemon class

2022-02-04 Thread Hanna Reitz
, but then launching a VM fails). We do not want the QSD to continue running after the test has failed, so __del__() will take care to kill it. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Hanna Reitz --- tests/qemu-iotests/iotests.py | 40 +++ 1 file changed

[PATCH v2 1/7] block/nbd: Delete reconnect delay timer when done

2022-02-04 Thread Hanna Reitz
access already-freed data). Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Hanna Reitz --- block/nbd.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/block/nbd.c b/block/nbd.c index 63dbfa807d..16cd7fef77 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -381,6 +381,13

[PATCH v2 0/7] block/nbd: Move s->ioc on AioContext change

2022-02-04 Thread Hanna Reitz
7/7:[] [--] 'iotests/281: Let NBD connection yield in iothread' Hanna Reitz (7): block/nbd: Delete reconnect delay timer when done block/nbd: Delete open timer when done block/nbd: Assert there are no timers when closed iotests.py: Add QemuStorageDaemon class iotests/281: Test linger

Re: [PATCH 4/7] iotests.py: Add QemuStorageDaemon class

2022-02-04 Thread Hanna Reitz
On 04.02.22 10:04, Vladimir Sementsov-Ogievskiy wrote: 03.02.2022 19:30, Hanna Reitz wrote: This is a rather simple class that allows creating a QSD instance running in the background and stopping it when no longer needed. The __del__ handler is a safety net for when something goes so wrong

Re: [PATCH 1/2] block: Lock AioContext for drain_end in blockdev-reopen

2022-02-03 Thread Hanna Reitz
: 3908b7a8994fa5ef7a89aa58cd5a02fc58141592 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2046659 Reported-by: Qing Wang Signed-off-by: Kevin Wolf --- blockdev.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) Reviewed-by: Hanna Reitz

Re: [PATCH 2/2] iotests: Test blockdev-reopen with iothreads and throttling

2022-02-03 Thread Hanna Reitz
if the lock hasn't correctly been taken. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/245 | 36 +--- tests/qemu-iotests/245.out | 4 ++-- 2 files changed, 35 insertions(+), 5 deletions(-) Reviewed-by: Hanna Reitz

[PATCH 5/7] iotests/281: Test lingering timers

2022-02-03 Thread Hanna Reitz
is precisely the scope of 281. The test case for that other bug will also be put into the test class added here. Also, excuse the test class's name, I couldn't come up with anything better. The "yield" part will make sense two patches from now.) Signed-off-by: Hanna Rei

[PATCH 6/7] block/nbd: Move s->ioc on AioContext change

2022-02-03 Thread Hanna Reitz
s->ioc must always be attached to the NBD node's AioContext. If that context changes, s->ioc must be attached to the new context. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2033626 Signed-off-by: Hanna Reitz --- block/nbd.c | 45 +

[PATCH 7/7] iotests/281: Let NBD connection yield in iothread

2022-02-03 Thread Hanna Reitz
B/s, and the NBD client reads 128 kB, so it should yield at some point. Signed-off-by: Hanna Reitz --- tests/qemu-iotests/281 | 28 +--- tests/qemu-iotests/281.out | 4 ++-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/281 b/tests

[PATCH 3/7] block/nbd: Assert there are no timers when closed

2022-02-03 Thread Hanna Reitz
exposes the bug. Signed-off-by: Hanna Reitz --- block/nbd.c | 4 1 file changed, 4 insertions(+) diff --git a/block/nbd.c b/block/nbd.c index 5ff8a57314..dc6c3f3bbc 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -110,6 +110,10 @@ static void nbd_clear_bdrvstate(BlockDriverState *bs

[PATCH 0/7] block/nbd: Move s->ioc on AioContext change

2022-02-03 Thread Hanna Reitz
(patches 1 and 2). Patch 3 adds an assertion that the timers are gone when the BDS is closed, so that we definitely won’t run into a situation where they access freed data. Hanna Reitz (7): block/nbd: Delete reconnect delay timer when done block/nbd: Delete open timer when done block/nbd: Assert

[PATCH 2/7] block/nbd: Delete open timer when done

2022-02-03 Thread Hanna Reitz
(), and just like the reconnect delay timer, it might well be dangerous if it were to fire afterwards. Signed-off-by: Hanna Reitz --- block/nbd.c | 8 1 file changed, 8 insertions(+) diff --git a/block/nbd.c b/block/nbd.c index 16cd7fef77..5ff8a57314 100644 --- a/block/nbd.c +++ b/block/nbd.c

[PATCH 4/7] iotests.py: Add QemuStorageDaemon class

2022-02-03 Thread Hanna Reitz
, but then launching a VM fails). We do not want the QSD to continue running after the test has failed, so __del__() will take care to kill it. Signed-off-by: Hanna Reitz --- tests/qemu-iotests/iotests.py | 42 +++ 1 file changed, 42 insertions(+) diff --git a/tests/qemu

[PATCH 1/7] block/nbd: Delete reconnect delay timer when done

2022-02-03 Thread Hanna Reitz
access already-freed data). Signed-off-by: Hanna Reitz --- block/nbd.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/block/nbd.c b/block/nbd.c index 63dbfa807d..16cd7fef77 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -381,6 +381,13 @@ static coroutine_fn void nbd_reconnect_attempt

Re: [PULL 18/20] block/nbd: drop connection_co

2022-02-02 Thread Hanna Reitz
On 02.02.22 14:53, Eric Blake wrote: On Wed, Feb 02, 2022 at 12:49:36PM +0100, Fabian Ebner wrote: Am 27.09.21 um 23:55 schrieb Eric Blake: From: Vladimir Sementsov-Ogievskiy OK, that's a big rewrite of the logic. Pre-patch we have an always running coroutine - connection_co. It does reply

Re: [RFC] block/nbd: Move s->ioc on AioContext change

2022-02-01 Thread Hanna Reitz
On 01.02.22 12:40, Hanna Reitz wrote: On 01.02.22 12:18, Vladimir Sementsov-Ogievskiy wrote: 28.01.2022 18:51, Hanna Reitz wrote: s->ioc must always be attached to the NBD node's AioContext.  If that context changes, s->ioc must be attached to the new context. Buglink:

[PULL 02/24] iotests/MRCE: Write data to source

2022-02-01 Thread Hanna Reitz
a flush, and so blkdebug only sees a single flush at the end of the job instead of two, and therefore does not inject an error, which makes the block job complete instead of raising an error. Signed-off-by: Hanna Reitz Message-Id: <20211223165308.103793-1-hre...@redhat.com> Reviewed-by: Vl

[PULL 08/24] iotests.py: rewrite default luks support in qemu_img

2022-02-01 Thread Hanna Reitz
From: Vladimir Sementsov-Ogievskiy Move the logic to more generic qemu_img_pipe_and_status(). Also behave better when we have several -o options. And reuse argument parser of course. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Message-Id: <20211223160144.109769

[PULL 19/24] iotests 60: more accurate set dirty bit in qcow2 header

2022-02-01 Thread Hanna Reitz
com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/060 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060 index d1e3204d4e..df87d600f7 100755 --- a/tests/qemu-iotests/060 +++ b/tests/qemu-iotests/060 @@ -326,7 +326,7 @@ _make_te

[PULL 15/24] iotests/common.rc: introduce _qcow2_dump_header helper

2022-02-01 Thread Hanna Reitz
ed-off-by: Hanna Reitz --- tests/qemu-iotests/common.rc | 10 ++ 1 file changed, 10 insertions(+) diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index d8582454de..5dea310ea0 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -996,5 +

[PULL 22/24] block-backend: Retain permissions after migration

2022-02-01 Thread Hanna Reitz
completion") Reported-by: Peng Liang Signed-off-by: Hanna Reitz Message-Id: <20211125135317.186576-2-hre...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Tested-by: Peng Liang --- block/block-backend.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/block/block-backe

[PULL 05/24] iotests: specify some unsupported_imgopts for python iotests

2022-02-01 Thread Hanna Reitz
-by: Vladimir Sementsov-Ogievskiy Message-Id: <20211223160144.1097696-4-vsement...@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/044 | 3 ++- tests/qemu-iotests/065 | 3 ++- tests/qemu-iotes

[PULL 01/24] tests/qemu-iotests: Fix 051 for binaries without 'lsi53c895a'

2022-02-01 Thread Hanna Reitz
: <20211206143404.247032-1-th...@redhat.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/051 | 4 1 file changed, 4 insertions(+) diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 index 1d2fa93a11..e9042a6214 100755 --- a/tests/qemu-iotests/051 +++ b/tests/qemu-iotests/051 @@

[PULL 23/24] iotests/migration-permissions: New test

2022-02-01 Thread Hanna Reitz
This test checks that a raw image in use by a virtio-blk device does not share the WRITE permission both before and after migration. Signed-off-by: Hanna Reitz --- .../qemu-iotests/tests/migration-permissions | 101 ++ .../tests/migration-permissions.out | 5 + 2

[PULL 04/24] iotests.py: implement unsupported_imgopts

2022-02-01 Thread Hanna Reitz
=$TEST_IMG.ext_data_file' in IMGOPTS, so, forbid this globally in iotests.py. Suggested-by: Hanna Reitz Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Message-Id: <20211223160144.1097696-3-vsement...@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/iote

[PULL 18/24] iotests: bash tests: filter compression type

2022-02-01 Thread Hanna Reitz
for it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Message-Id: <20211223160144.1097696-17-vsement...@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/060.out | 2 +- tests/qemu-iotests/061.out | 12 ++-- tests/qemu-iotests/0

[PULL 00/24] Block patches

2022-02-01 Thread Hanna Reitz
-migration block node permissions - iotests fixes (051 and mirror-ready-cancel-error) - Remove an outdated comment Emanuele Giuseppe Esposito (1): block.h: remove outdated comment Hanna Reitz (3): iotests/MRCE: Write data to source

[PULL 24/24] block.h: remove outdated comment

2022-02-01 Thread Hanna Reitz
-by: Kevin Wolf Signed-off-by: Emanuele Giuseppe Esposito Message-Id: <20220131125615.74612-1-eespo...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Hanna Reitz --- include/block/block.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/block/block.h b/include/blo

[PULL 13/24] iotest 302: use img_info_log() helper

2022-02-01 Thread Hanna Reitz
ssion_type && version >= 3) { qcow2_opts->has_compression_type = true; qcow2_opts->compression_type = QCOW2_COMPRESSION_TYPE_ZSTD; } Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id: <20211223160144.1097696-12-vsement...@virtuozzo.co

[PULL 12/24] iotests.py: filter compression type out

2022-02-01 Thread Hanna Reitz
safely filter out compression type in all qcow2 tests. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Message-Id: <20211223160144.1097696-11-vsement...@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/206.out| 10 +- tests/qemu-iotests/2

[PULL 07/24] iotests: drop qemu_img_verbose() helper

2022-02-01 Thread Hanna Reitz
Reviewed-by: Hanna Reitz Message-Id: <20211223160144.1097696-6-vsement...@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/044| 5 +++-- tests/qemu-iotests/044.out| 1 + tests/qemu-iotests/209| 7 --- tests/qemu-iotests/209.out| 2 ++ tests/qemu-i

[PULL 09/24] iotest 303: explicit compression type

2022-02-01 Thread Hanna Reitz
Reitz Message-Id: <20211223160144.1097696-8-vsement...@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/303 | 25 - tests/qemu-iotests/303.out | 30 +- 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a

[PULL 06/24] iotests.py: qemu_img*("create"): support IMGOPTS='compression_type=zstd'

2022-02-01 Thread Hanna Reitz
using qemu_img*('create') - add assertions.. That doesn't seem good. So, let's add support of IMGOPTS to most generic qemu_img_pipe_and_status(). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Message-Id: <20211223160144.1097696-5-vsement...@virtuozzo.com> Sign

[PULL 11/24] iotests.py: filter out successful output of qemu-img create

2022-02-01 Thread Hanna Reitz
From: Vladimir Sementsov-Ogievskiy The only "feature" of this "Formatting ..." line is that we have to update it every time we add new option. Let's drop it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Message-Id: <20211223160144.1097696-10-v

[PULL 21/24] iotests: declare lack of support for compresion_type in IMGOPTS

2022-02-01 Thread Hanna Reitz
From: Vladimir Sementsov-Ogievskiy compression_type can't be used if we want to create image with compat=0.10. So, skip these tests, not many of them. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Message-Id: <20211223160144.1097696-20-vsement...@virtuozzo.com>

[PULL 03/24] iotests.py: img_info_log(): rename imgopts argument

2022-02-01 Thread Hanna Reitz
Reviewed-by: Max Reitz Message-Id: <20211223160144.1097696-2-vsement...@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/210| 8 tests/qemu-iotests/iotests.py | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/210 b/test

[PULL 20/24] iotest 214: explicit compression type

2022-02-01 Thread Hanna Reitz
Max Reitz Message-Id: <20211223160144.1097696-19-vsement...@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/214 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/214 b/tests/qemu-iotests/214 index 0889089d81..c66e246ba2 100755 --- a/te

[PULL 16/24] iotests: massive use _qcow2_dump_header

2022-02-01 Thread Hanna Reitz
difficulty is to avoid converting dump-header-exts) Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id: <20211223160144.1097696-15-vsement...@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/031 | 6 +++--- tests/qemu-iotests/036 | 6 +++--- tests/

[PULL 14/24] qcow2: simple case support for downgrading of qcow2 images with zstd

2022-02-01 Thread Hanna Reitz
checkpatch complain against '#' in printf formatting. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-Id: <20211223160144.1097696-13-vsement...@virtuozzo.com> Signed-off-by: Hanna Reitz --- block/qcow2.c | 58 +--

[PULL 17/24] iotest 39: use _qcow2_dump_header

2022-02-01 Thread Hanna Reitz
com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/039 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039 index 8e783a8380..00d379cde2 100755 --- a/tests/qemu-iotests/039 +++ b/tests/qemu-iotests/039 @@ -142,7 +142,7 @@ $QEMU_IMG

[PULL 10/24] iotest 065: explicit compression type

2022-02-01 Thread Hanna Reitz
Reviewed-by: Hanna Reitz Message-Id: <20211223160144.1097696-9-vsement...@virtuozzo.com> Signed-off-by: Hanna Reitz --- tests/qemu-iotests/065 | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/qemu-iotests/065 b/tests/qemu-iotests/065 index dc77

Re: [PATCH] block/curl.c: Check error return from curl_easy_setopt()

2022-02-01 Thread Hanna Reitz
On 28.01.22 17:55, Peter Maydell wrote: Coverity points out that we aren't checking the return value from curl_easy_setopt() for any of the calls to it we make in block/curl.c. Fixes: Coverity CID 1459336, 1459482, 1460331 Signed-off-by: Peter Maydell --- Big fat disclaimer: tested only with

Re: [PATCH] block.h: remove outdated comment

2022-02-01 Thread Hanna Reitz
On 31.01.22 13:56, Emanuele Giuseppe Esposito wrote: The comment "disk I/O throttling" doesn't make any sense at all any more. It was added in commit 0563e191516 to describe bdrv_io_limits_enable()/disable(), which were removed in commit 97148076, so the comment is just a forgotten leftover.

Re: [PATCH v3 2/2] block/export/fuse: Fix build failure on FreeBSD

2022-02-01 Thread Hanna Reitz
On 01.02.22 12:26, Philippe Mathieu-Daudé wrote: When building on FreeBSD we get: [816/6851] Compiling C object libblockdev.fa.p/block_export_fuse.c.o ../block/export/fuse.c:628:16: error: use of undeclared identifier 'FALLOC_FL_KEEP_SIZE' if (mode & FALLOC_FL_KEEP_SIZE) {

Re: [RFC] block/nbd: Move s->ioc on AioContext change

2022-02-01 Thread Hanna Reitz
On 01.02.22 12:18, Vladimir Sementsov-Ogievskiy wrote: 28.01.2022 18:51, Hanna Reitz wrote: s->ioc must always be attached to the NBD node's AioContext.  If that context changes, s->ioc must be attached to the new context. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1990835 Sign

[PATCH] qemu-img: Unify [-b [-F]] documentation

2022-01-31 Thread Hanna Reitz
document it that way, as we have already done for qemu-img convert (commit 1899bf47375ad40555dcdff12ba49b4b8b82df38). Reported-by: Tingting Mao Signed-off-by: Hanna Reitz --- docs/tools/qemu-img.rst | 2 +- qemu-img-cmds.hx| 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff

[PATCH v2] qsd: Document fuse's allow-other option

2022-01-31 Thread Hanna Reitz
We did not add documentation to the storage daemon's man page for fuse's allow-other option when it was introduced, so do that now. Fixes: 8fc54f9428b9763f800 ("export/fuse: Add allow-other option") Signed-off-by: Hanna Reitz --- v2: - Replaced instances of "QSD" by more

Re: [PATCH v6 29/33] job.h: assertions in the callers of JobDriver funcion pointers

2022-01-31 Thread Hanna Reitz
On 28.01.22 16:19, Emanuele Giuseppe Esposito wrote: On 26/01/2022 15:13, Hanna Reitz wrote: On 21.01.22 18:05, Emanuele Giuseppe Esposito wrote: Signed-off-by: Emanuele Giuseppe Esposito ---   job.c | 9 +   1 file changed, 9 insertions(+) Just curious, why did you remove

Re: [PATCH] qsd: Document fuse's allow-other option

2022-01-28 Thread Hanna Reitz
On 27.01.22 17:02, Kevin Wolf wrote: Am 24.01.2022 um 18:03 hat Hanna Reitz geschrieben: We did not add documentation to the storage daemon's man page for fuse's allow-other option when it was introduced, so do that now. Fixes: 8fc54f9428b9763f800 ("export/fuse: Add allow-other option&quo

[RFC] block/nbd: Move s->ioc on AioContext change

2022-01-28 Thread Hanna Reitz
s->ioc must always be attached to the NBD node's AioContext. If that context changes, s->ioc must be attached to the new context. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1990835 Signed-off-by: Hanna Reitz --- This is an RFC because I believe there are some other things in t

Re: Block alignment of qcow2 compress driver

2022-01-28 Thread Hanna Reitz
On 28.01.22 13:18, Richard W.M. Jones wrote: On Fri, Jan 28, 2022 at 12:57:47PM +0100, Hanna Reitz wrote: On 28.01.22 12:48, Richard W.M. Jones wrote: On Fri, Jan 28, 2022 at 12:39:11PM +0100, Hanna Reitz wrote: So I actually don’t know why it works for you.  OTOH, I don’t understand why

Re: Block alignment of qcow2 compress driver

2022-01-28 Thread Hanna Reitz
On 28.01.22 12:48, Richard W.M. Jones wrote: On Fri, Jan 28, 2022 at 12:39:11PM +0100, Hanna Reitz wrote: So I actually don’t know why it works for you.  OTOH, I don’t understand why the block size affects you over NBD, because I would have expected qemu to internally auto-align requests when

Re: Block alignment of qcow2 compress driver

2022-01-28 Thread Hanna Reitz
On 28.01.22 12:07, Richard W.M. Jones wrote: The commands below set up a sparse RAM disk, with an allocated block at offset 32K and another one at offset 1M-32K. Then it tries to copy this to a compressed qcow2 file using qemu-nbd + the qemu compress filter: $ qemu-img create -f qcow2

Re: [PATCH v3 4/4] python/aqmp: add socket bind step to legacy.py

2022-01-27 Thread Hanna Reitz
On 24.01.22 19:06, John Snow wrote: The synchronous QMP library would bind to the server address during __init__(). The new library delays this to the accept() call, because binding occurs inside of the call to start_[unix_]server(), which is an async method -- so it cannot happen during

Re: [PATCH v3 2/4] python/machine: raise VMLaunchFailure exception from launch()

2022-01-27 Thread Hanna Reitz
ython/qemu/machine/machine.py| 45 --- tests/qemu-iotests/tests/mirror-top-perms | 3 +- 2 files changed, 40 insertions(+), 8 deletions(-) Reviewed-by: Hanna Reitz (Looked at `except` and `ConnectError` usage outside of mirror-top-perms, but couldn’t find any

Re: [PATCH v3 1/4] python/aqmp: Fix negotiation with pre-"oob" QEMU

2022-01-27 Thread Hanna Reitz
hanged, 2 insertions(+), 2 deletions(-) Reviewed-by: Hanna Reitz

Re: [PATCH] qemu-storage-daemon: Fix typo in vhost-user-blk help

2022-01-26 Thread Hanna Reitz
On 25.01.22 16:15, Kevin Wolf wrote: The syntax of the fd passing case misses the "addr.type=" key. Add it. Signed-off-by: Kevin Wolf --- storage-daemon/qemu-storage-daemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Hanna Reitz

Re: [PATCH v6 32/33] crypto: delegate permission functions to JobDriver .pre_run

2022-01-26 Thread Hanna Reitz
On 21.01.22 18:05, Emanuele Giuseppe Esposito wrote: block_crypto_amend_options_generic_luks uses the block layer permission API, therefore it should be called with the BQL held. However, the same function is being called by two BlockDriver callbacks: bdrv_amend_options (under BQL) and

Re: [PATCH v6 31/33] include/qemu/job.h: introduce job->pre_run() and use it in amend

2022-01-26 Thread Hanna Reitz
On 21.01.22 18:05, Emanuele Giuseppe Esposito wrote: Introduce .pre_run() job callback. This cb will run in job_start, before the coroutine is created and runs run() in the job aiocontext. I presume this means “before the coroutine is created that will run run() in the job aiocontext”? (The

Re: [PATCH v6 30/33] include/block/block_int-common.h: introduce bdrv_amend_pre_run and bdrv_amend_clean

2022-01-26 Thread Hanna Reitz
On 21.01.22 18:05, Emanuele Giuseppe Esposito wrote: These two callbacks will be invoked by job callbacks to execute driver-specific code while still being in BQL. In this example, we want the amend JobDriver to execute the permission check (bdrv_child_refresh_perms) currently only done in

Re: [PATCH v6 29/33] job.h: assertions in the callers of JobDriver funcion pointers

2022-01-26 Thread Hanna Reitz
On 21.01.22 18:05, Emanuele Giuseppe Esposito wrote: Signed-off-by: Emanuele Giuseppe Esposito --- job.c | 9 + 1 file changed, 9 insertions(+) Just curious, why did you remove the assertion in job_co_entry()? (Looking at it again, it might have been nicer to swap it with the

Re: [PATCH v6 26/33] block_int-common.h: assertions in the callers of BdrvChildClass function pointers

2022-01-26 Thread Hanna Reitz
S-only function. Since I leave that up to you, though (and this patch interestingly (and correctly) doesn’t add an assertion to bdrv_get_parent_name(), even though that calls `.get_name()`, which the previous patch did classify as GS): Reviewed-by: Hanna Reitz

Re: [PATCH v6 25/33] block_int-common.h: split function pointers in BdrvChildClass

2022-01-26 Thread Hanna Reitz
On 21.01.22 18:05, Emanuele Giuseppe Esposito wrote: Signed-off-by: Emanuele Giuseppe Esposito --- include/block/block_int-common.h | 67 +++- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/include/block/block_int-common.h

Re: [PATCH v6 23/33] block_int-common.h: split function pointers in BlockDriver

2022-01-26 Thread Hanna Reitz
On 21.01.22 18:05, Emanuele Giuseppe Esposito wrote: Similar to the header split, also the function pointers in BlockDriver can be split in I/O and global state. Signed-off-by: Emanuele Giuseppe Esposito --- include/block/block_int-common.h | 434 --- 1 file

Re: [PATCH v6 21/33] block: move BQL logic of bdrv_co_invalidate_cache in bdrv_activate

2022-01-26 Thread Hanna Reitz
On 21.01.22 18:05, Emanuele Giuseppe Esposito wrote: Split bdrv_co_invalidate cache in two: the GS code that takes care of permissions and running GS callbacks, and leave only the I/O code (->bdrv_co_invalidate_cache) running in the I/O coroutine. The only side effect is that

Re: [PATCH v6 20/33] block: rename bdrv_invalidate_cache_all, blk_invalidate_cache and test_sync_op_invalidate_cache

2022-01-26 Thread Hanna Reitz
anged, 18 insertions(+), 18 deletions(-) Reviewed-by: Hanna Reitz

Re: [PATCH v6 19/33] block: introduce bdrv_activate

2022-01-26 Thread Hanna Reitz
-global-state.h | 2 +- tests/unit/test-block-iothread.c | 2 +- 6 files changed, 11 insertions(+), 6 deletions(-) Reviewed-by: Hanna Reitz

Re: [PATCH v6 06/33] block/block-backend.c: assertions for block-backend

2022-01-26 Thread Hanna Reitz
On 21.01.22 18:05, Emanuele Giuseppe Esposito wrote: All the global state (GS) API functions will check that qemu_in_main_thread() returns true. If not, it means that the safety of BQL cannot be guaranteed, and they need to be moved to I/O. Signed-off-by: Emanuele Giuseppe Esposito ---

Re: [PATCH v6 04/33] block/export/fuse.c: allow writable exports to take RESIZE permission

2022-01-25 Thread Hanna Reitz
if an error were to occur, qemu would abort. Not that I mind adding an assertion on the return value, just noting that we omitted that kind of intentionally. Reviewed-by: Hanna Reitz Signed-off-by: Emanuele Giuseppe Esposito --- block/export/fuse.c | 25 ++--- 1 file

[PATCH] qsd: Document fuse's allow-other option

2022-01-24 Thread Hanna Reitz
We did not add documentation to the storage daemon's man page for fuse's allow-other option when it was introduced, so do that now. Fixes: 8fc54f9428b9763f800 ("export/fuse: Add allow-other option") Signed-off-by: Hanna Reitz --- docs/tools/qemu-storage-daemon.rst | 9 +++-

Re: [PATCH 1/3] qsd: Add pre-init argument parsing pass

2022-01-24 Thread Hanna Reitz
On 24.01.22 10:23, Markus Armbruster wrote: Hanna Reitz writes: On 21.01.22 15:26, Markus Armbruster wrote: Hanna Reitz writes: On 21.01.22 11:27, Markus Armbruster wrote: Hanna Reitz writes: The problem I face is that currently there is no ergonomic way to wait until the QSD is up

Re: [PATCH v2] ide: Increment BB in-flight counter for TRIM BH

2022-01-24 Thread Hanna Reitz
On 21.01.22 19:47, John Snow wrote: On Thu, Jan 20, 2022 at 9:23 AM Hanna Reitz wrote: When we still have an AIOCB registered for DMA operations, we try to settle the respective operation by draining the BlockBackend associated with the IDE device. However, this assumes that every DMA

Re: [PATCH 1/3] qsd: Add pre-init argument parsing pass

2022-01-24 Thread Hanna Reitz
On 21.01.22 15:26, Markus Armbruster wrote: Hanna Reitz writes: On 21.01.22 11:27, Markus Armbruster wrote: Hanna Reitz writes: The problem I face is that currently there is no ergonomic way to wait until the QSD is up and running (besides looping until the PID file exists), and I don’t

Re: [PATCH 1/3] qsd: Add pre-init argument parsing pass

2022-01-21 Thread Hanna Reitz
On 21.01.22 11:27, Markus Armbruster wrote: Hanna Reitz writes: On 21.01.22 07:10, Markus Armbruster wrote: Hanna Reitz writes: On 20.01.22 17:00, Markus Armbruster wrote: Kevin Wolf writes: Am 19.01.2022 um 14:44 hat Hanna Reitz geschrieben: On 19.01.22 13:58, Markus Armbruster

Re: [PATCH 1/3] qsd: Add pre-init argument parsing pass

2022-01-21 Thread Hanna Reitz
On 21.01.22 07:10, Markus Armbruster wrote: Hanna Reitz writes: On 20.01.22 17:00, Markus Armbruster wrote: Kevin Wolf writes: Am 19.01.2022 um 14:44 hat Hanna Reitz geschrieben: On 19.01.22 13:58, Markus Armbruster wrote: Hanna Reitz writes: We want to add a --daemonize argument

Re: [PATCH 1/3] qsd: Add pre-init argument parsing pass

2022-01-20 Thread Hanna Reitz
On 20.01.22 17:00, Markus Armbruster wrote: Kevin Wolf writes: Am 19.01.2022 um 14:44 hat Hanna Reitz geschrieben: On 19.01.22 13:58, Markus Armbruster wrote: Hanna Reitz writes: We want to add a --daemonize argument to QSD's command line. Why? OK, s/we/I/.  I find it useful, because

Re: [PATCH v3 10/19] block: introduce fleecing block driver

2022-01-20 Thread Hanna Reitz
On 22.12.21 18:40, Vladimir Sementsov-Ogievskiy wrote: Introduce a new driver, that works in pair with copy-before-write to improve fleecing. Without fleecing driver, old fleecing scheme looks as follows: [guest] | |root v [copy-before-write] -> [temp.qcow2] <--- [nbd export] |

[PATCH v2] ide: Increment BB in-flight counter for TRIM BH

2022-01-20 Thread Hanna Reitz
_trim_bh_cb() is done. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2029980 Suggested-by: Paolo Bonzini Signed-off-by: Hanna Reitz --- v1: https://lists.nongnu.org/archive/html/qemu-block/2022-01/msg00024.html v2: - Increment BB’s in-flight counter while the BH is active so that blk_dr

Re: [PATCH v5 28/31] block.c: assert BQL lock held in bdrv_co_invalidate_cache

2022-01-19 Thread Hanna Reitz
On 19.01.22 16:57, Hanna Reitz wrote: On 23.12.21 18:11, Hanna Reitz wrote: On 20.12.21 13:20, Emanuele Giuseppe Esposito wrote: On 17/12/2021 17:38, Emanuele Giuseppe Esposito wrote: On 17/12/2021 12:04, Hanna Reitz wrote: On 24.11.21 07:44, Emanuele Giuseppe Esposito wrote

Re: [PATCH v5 28/31] block.c: assert BQL lock held in bdrv_co_invalidate_cache

2022-01-19 Thread Hanna Reitz
On 23.12.21 18:11, Hanna Reitz wrote: On 20.12.21 13:20, Emanuele Giuseppe Esposito wrote: On 17/12/2021 17:38, Emanuele Giuseppe Esposito wrote: On 17/12/2021 12:04, Hanna Reitz wrote: On 24.11.21 07:44, Emanuele Giuseppe Esposito wrote: bdrv_co_invalidate_cache is special: it is an I/O

Re: [PATCH 1/3] qsd: Add pre-init argument parsing pass

2022-01-19 Thread Hanna Reitz
On 19.01.22 13:58, Markus Armbruster wrote: Hanna Reitz writes: We want to add a --daemonize argument to QSD's command line. Why? OK, s/we/I/.  I find it useful, because without such an option, I need to have whoever invokes QSD loop until the PID file exists, before I can be sure

Re: [PATCH] ide: Explicitly poll for BHs on cancel

2022-01-19 Thread Hanna Reitz
On 19.01.22 12:11, Paolo Bonzini wrote: On 1/5/22 12:13, Hanna Reitz wrote: - assert(s->bus->dma->aiocb == NULL); + +    /* + * Wait for potentially still-scheduled BHs, like ide_trim_bh_cb() + * (blk_drain() will only poll if there are in-flight

[PATCH v2 2/2] iotests/block-status-cache: New test

2022-01-18 Thread Hanna Reitz
the qemu:allocation-depth context. (This test case cannot be integrated into nbd-qemu-allocation, because that is a qcow2 test, and this is a raw test.) Signed-off-by: Hanna Reitz --- tests/qemu-iotests/tests/block-status-cache | 139 ++ .../qemu-iotests/tests/block-status-cache.out | 5

Re: [PATCH 2/2] iotests/block-status-cache: New test

2022-01-18 Thread Hanna Reitz
On 17.01.22 18:57, Nir Soffer wrote: On Mon, Jan 17, 2022 at 6:26 PM Hanna Reitz wrote: Add a new test to verify that want_zero=false block-status calls do not pollute the block-status cache for want_zero=true calls. We check want_zero=true calls and their results using `qemu-img map` (over

[PATCH v2 1/2] block/io: Update BSC only if want_zero is true

2022-01-18 Thread Hanna Reitz
. Therefore, we should not update the cache with want_zero=false. Reported-by: Nir Soffer Fixes: 0bc329fbb00 ("block: block-status cache for data regions") Reviewed-by: Nir Soffer Cc: qemu-sta...@nongnu.org Signed-off-by: Hanna Reitz --- block/io.c | 6 +- 1 file changed, 5 insert

[PATCH v2 0/2] block/io: Update BSC only if want_zero is true

2022-01-18 Thread Hanna Reitz
upstream/downstream patch [down] : patch is downstream-only The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively 001/2:[] [--] 'block/io: Update BSC only if want_zero is true' 002/2:[0013] [FC] 'iotests/block-status-cache: New test' Hanna Reitz (2): block/io: Update

Re: [PATCH v3 09/19] block: introduce FleecingState class

2022-01-18 Thread Hanna Reitz
On 22.12.21 18:40, Vladimir Sementsov-Ogievskiy wrote: FleecingState represents state shared between copy-before-write filter and upcoming fleecing block driver. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/fleecing.h | 135 ++ block/fleecing.c |

Re: [PATCH v3 08/19] block/reqlist: add reqlist_wait_all()

2022-01-18 Thread Hanna Reitz
(BlockReqList *reqs, int64_t offset, int64_t bytes, CoMutex *lock); +/* + * Wait for all intersecting requests. It just calls reqlist_wait_one() in a + * loops, caller is responsible to stop producing new requests in this region s/loops/loop/ Reviewed-by: Hanna

Re: [PATCH v3 07/19] block/dirty-bitmap: introduce bdrv_dirty_bitmap_status()

2022-01-18 Thread Hanna Reitz
On 22.12.21 18:40, Vladimir Sementsov-Ogievskiy wrote: Add a convenient function similar with bdrv_block_status() to get status of dirty bitmap. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/dirty-bitmap.h | 2 ++ include/qemu/hbitmap.h | 11 +++

[PATCH 0/2] block/io: Update BSC only if want_zero is true

2022-01-17 Thread Hanna Reitz
think want_zero=false generally is fast enough(tm), that’s why we introduced want_zero after all.) Patch 1 is the fix, patch 2 a regression test. Hanna Reitz (2): block/io: Update BSC only if want_zero is true iotests/block-status-cache: New test block/io.c

Re: [PATCH 0/2] block/io: Update BSC only if want_zero is true

2022-01-17 Thread Hanna Reitz
Forgot to CC qemu-stable. On 17.01.22 17:26, Hanna Reitz wrote: Hi, As reported by Nir (https://lists.nongnu.org/archive/html/qemu-block/2022-01/msg00292.html) there’s a problem with the block-status cache, namely that it is updated when want_zero is false, but we return the result later even

[PATCH 2/2] iotests/block-status-cache: New test

2022-01-17 Thread Hanna Reitz
the qemu:allocation-depth context. (This test case cannot be integrated into nbd-qemu-allocation, because that is a qcow2 test, and this is a raw test.) Signed-off-by: Hanna Reitz --- tests/qemu-iotests/tests/block-status-cache | 130 ++ .../qemu-iotests/tests/block-status-cache.out | 5

[PATCH 1/2] block/io: Update BSC only if want_zero is true

2022-01-17 Thread Hanna Reitz
. Therefore, we should not update the cache with want_zero=false. Reported-by: Nir Soffer Fixes: 0bc329fbb009f8601cec23bf2bc48ead0c5a5fa2 ("block: block-status cache for data regions") Signed-off-by: Hanna Reitz --- block/io.c | 6 +- 1 file changed, 5 insertions(+), 1 deletio

Re: [PATCH v3 06/19] block: intoduce reqlist

2022-01-14 Thread Hanna Reitz
On 22.12.21 18:40, Vladimir Sementsov-Ogievskiy wrote: Split intersecting-requests functionality out of block-copy to be reused in copy-before-write filter. Note: while being here, fix tiny typo in MAINTAINERS. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/reqlist.h | 67

Re: [PATCH v3 05/19] block/block-copy: add block_copy_reset()

2022-01-14 Thread Hanna Reitz
files changed, 14 insertions(+), 8 deletions(-) Reviewed-by: Hanna Reitz

Re: [PATCH v3 04/19] block/copy-before-write: add bitmap open parameter

2022-01-14 Thread Hanna Reitz
On 22.12.21 18:40, Vladimir Sementsov-Ogievskiy wrote: This brings "incremental" mode to copy-before-write filter: user can specify bitmap so that filter will copy only "dirty" areas. Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 10 +-

<    1   2   3   4   5   6   7   8   9   10   >