Re: [PATCH v2 2/9] block: drop write notifiers

2021-05-05 Thread Max Reitz
: Max Reitz

Re: [PATCH v2 1/9] block/write-threshold: don't use write notifiers

2021-05-05 Thread Max Reitz
wo cases (one for offset > wtr, one for end > wtr). Perhaps overflow considerations? Shouldn’t matter though. +bdrv_write_threshold_set(bs, 0); I’d keep the comment from before_write_notify() here (i.e. “autodisable to avoid flooding the monitor”). But other than that, I have n

Re: [PATCH v2] Document qemu-img options data_file and data_file_raw

2021-05-04 Thread Max Reitz
On 04.05.21 01:15, Connor Kuehl wrote: On 4/30/21 9:45 AM, Max Reitz wrote: + ``data_file_raw`` +If this option is set to ``on``, QEMU will always keep the external +data file consistent as a standalone read-only raw image. It does +this by forwarding updates through to the raw

Re: [PATCH v3 14/15] qemu_iotests: add option to show qemu binary logs on stdout

2021-05-03 Thread Max Reitz
On 30.04.21 23:04, Emanuele Giuseppe Esposito wrote: On 30/04/2021 15:50, Max Reitz wrote: On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: Using the flag -p, allow the qemu binary to print to stdout. This helps especially when doing print-debugging. I think this shouldn’t refer to

Re: [PATCH v3 05/15] qemu-iotests: delay QMP socket timers

2021-05-03 Thread Max Reitz
On 30.04.21 23:03, Emanuele Giuseppe Esposito wrote: On 30/04/2021 13:59, Max Reitz wrote: On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: Attaching a gdbserver implies that the qmp socket should wait indefinitely for an answer from QEMU. Signed-off-by: Emanuele Giuseppe Esposito

Re: [PATCH v3 04/15] qemu-iotests: add option to attach gdbserver

2021-05-03 Thread Max Reitz
On 30.04.21 23:03, Emanuele Giuseppe Esposito wrote: On 30/04/2021 13:38, Max Reitz wrote: On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: Add -gdb flag and GDB_QEMU environmental variable to python tests to attach a gdbserver to each qemu instance. Well, this patch doesn’t do this

Re: [PATCH v4 0/5] qemu-iotests: quality of life improvements

2021-05-03 Thread Max Reitz
On 03.05.21 13:01, Paolo Bonzini wrote: This series adds a few usability improvements to qemu-iotests, mostly for Python unittest-based tests. In particular: - the output of the unittest framework is not buffered, which makes it easier to follow the "-d" output of the tests - arguments can

Re: [PATCH 1/2] block: Fix Transaction leak in bdrv_root_attach_child()

2021-05-03 Thread Max Reitz
On 03.05.21 13:51, Vladimir Sementsov-Ogievskiy wrote: 03.05.2021 14:49, Max Reitz wrote: On 03.05.21 13:05, Kevin Wolf wrote: The error path needs to call tran_finalize(), too. Fixes: CID 1452773 Fixes: 548a74c0dbc858edd1a7ee3045b5f2fe710bd8b1 Signed-off-by: Kevin Wolf ---   block.c | 7

Re: [PATCH 1/2] block: Fix Transaction leak in bdrv_root_attach_child()

2021-05-03 Thread Max Reitz
OK, so: Reviewed-by: Max Reitz However, the function’s description says that it will return NULL on error. But if bdrv_refresh_perms() fails, it will still return a non-NULL child. Is that right?

[PATCH] block/snapshot: Clarify goto fallback behavior

2021-05-03 Thread Max Reitz
All of this is not immediately clear from a quick glance at the code, so add a comment to the assertion what it is for, and why it is valid. It certainly confused Coverity. Reported-by: Coverity (CID 1452774) Signed-off-by: Max Reitz --- block/snapshot.c | 14 +- 1 file changed, 13 in

Re: [PULL 37/64] block/snapshot: Fix fallback

2021-05-03 Thread Max Reitz
On 03.05.21 11:40, Kevin Wolf wrote: Am 01.05.2021 um 00:30 hat Peter Maydell geschrieben: On Mon, 7 Sept 2020 at 12:11, Kevin Wolf wrote: From: Max Reitz If the top node's driver does not provide snapshot functionality and we want to fall back to a node down the chain, we need to sna

Re: [PATCH v2] Document qemu-img options data_file and data_file_raw

2021-04-30 Thread Max Reitz
On 30.04.21 15:34, Connor Kuehl wrote: The contents of this patch were initially developed and posted by Han Han[1], however, it appears the original patch was not applied. Since then, the relevant documentation has been moved and adapted to a new format. I've taken most of the original wording

Re: [PATCH v3 15/15] docs/devel/testing: add -p option to the debug section of QEMU iotests

2021-04-30 Thread Max Reitz
On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: Signed-off-by: Emanuele Giuseppe Esposito --- docs/devel/testing.rst | 4 1 file changed, 4 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index 62902cfd2d..0c18fc4571 100644 --- a/docs/devel/testing.rst ++

Re: [PATCH v3 14/15] qemu_iotests: add option to show qemu binary logs on stdout

2021-04-30 Thread Max Reitz
uot; +PRINT_QEMU-- "{PRINT_QEMU}" Again, I personally don’t like the quotes. (I think “PRINT_QEMU -- y” and “PRINT_QEMU --” look better.) Another thing: Here in this place, the name of the environment variable is visible. “PRINT_QEMU” doesn’t really have meaning; now, if it weren’t visible, I wouldn’t care, but here it is visible. Perhaps “PRINT_QEMU_OUTPUT”, or "SHOW_QEMU_OUTPUT" would mean more? Well, it’s all bike-shedding, so with “is not None” and the add_argument line broken so it doesn’t exceed 79 characters: Reviewed-by: Max Reitz """ args = collections.defaultdict(str, self.get_env())

Re: [PATCH v3 08/15] docs/devel/testing: add -gdb option to the debugging section of QEMU iotests

2021-04-30 Thread Max Reitz
On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: Signed-off-by: Emanuele Giuseppe Esposito --- docs/devel/testing.rst | 7 +++ 1 file changed, 7 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index b7e2370e7e..2ee77a057b 100644 --- a/docs/devel/testing.rst

Re: [PATCH v3 12/15] qemu_iotests: insert valgrind command line as wrapper for qemu binary

2021-04-30 Thread Max Reitz
changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Max Reitz

Re: [PATCH v3 13/15] docs/devel/testing: add -valgrind option to the debug section of QEMU iotests

2021-04-30 Thread Max Reitz
native speaker, but I think it should be “attaches ... to QEMU”, “wraps QEMU in a valgrind instances”, or “wraps ... around QEMU". Apart from that: Reviewed-by: Max Reitz + warnings, it will print and save the log in + ``$TEST_DIR/.valgrind``. + The final command line will be ``valgrind

Re: [PATCH v3 11/15] qemu_iotests: allow valgrind to read/delete the generated log file

2021-04-30 Thread Max Reitz
On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: When using -valgrind on the script tests, it generates a log file in $TEST_DIR that is either read (if valgrind finds problems) or otherwise deleted. Provide the same exact behavior when using -valgrind on the python tests. Signed-off-by: Eman

Re: [PATCH v3 10/15] qemu_iotests: extent QMP socket timeout when using valgrind

2021-04-30 Thread Max Reitz
On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: As with gdbserver, valgrind delays the test execution, so the default QMP socket timeout timeout too soon. I’m curious: The default timeouts should be long enough for slow systems, too, though (e.g. heavily-loaded CI systems). I would expec

Re: [PATCH v3 06/15] qemu_iotests: insert gdbserver command line as wrapper for qemu binary

2021-04-30 Thread Max Reitz
On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/iotests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Max Reitz

Re: [PATCH v3 07/15] qemu-iotests: add gdbserver option to script tests too

2021-04-30 Thread Max Reitz
On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: The only limitation here is that running a script with gdbserver will make the test output mismatch with the expected results, making the test fail. Signed-off-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/common.rc | 8 +++- 1

Re: [PATCH v3 09/15] qemu_iotests: extend the check script to support valgrind for python tests

2021-04-30 Thread Max Reitz
T_SCM_HELPER -- {SOCKET_SCM_HELPER} GDB_QEMU -- "{GDB_QEMU}" +VALGRIND_QEMU -- "{VALGRIND_QEMU}" I don’t think this should be enclosed in quotes (and neither should GDB_QEMU be). AFAIU, only the *_PROG options are quoted to signify that they will be executed as a single program, whether they include spaces or not. OTOH, GDB_QEMU is a list of options, so spaces act as separators, and VALGRIND_QEMU is just y or not set, so it’s impossible for spaces to be in there. (Also, I think the “--” should be aligned to all the other “--”s.) Bikeshedding, though, so: Reviewed-by: Max Reitz """ args = collections.defaultdict(str, self.get_env())

Re: [PATCH v3 04/15] qemu-iotests: add option to attach gdbserver

2021-04-30 Thread Max Reitz
On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: Add -gdb flag and GDB_QEMU environmental variable to python tests to attach a gdbserver to each qemu instance. if -gdb is not provided but $GDB_QEMU is set, ignore the environmental variable. Signed-off-by: Emanuele Giuseppe Esposito --- t

Re: [PATCH v3 05/15] qemu-iotests: delay QMP socket timers

2021-04-30 Thread Max Reitz
On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: Attaching a gdbserver implies that the qmp socket should wait indefinitely for an answer from QEMU. Signed-off-by: Emanuele Giuseppe Esposito --- python/qemu/machine.py| 3 +++ tests/qemu-iotests/iotests.py | 10 +- 2 fil

Re: [PATCH v3 04/15] qemu-iotests: add option to attach gdbserver

2021-04-30 Thread Max Reitz
On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: Add -gdb flag and GDB_QEMU environmental variable to python tests to attach a gdbserver to each qemu instance. Well, this patch doesn’t do this, but OK. Out of interest: Why gdbserver and not “just” gdb? On Fedora, those are separate packa

Re: [PATCH v3 03/15] docs/devel/testing: add debug section to the QEMU iotests chapter

2021-04-30 Thread Max Reitz
On 14.04.21 19:03, Emanuele Giuseppe Esposito wrote: Introduce the "Debugging a test case" section, in preparation to the additional flags that will be added in the next patches. Signed-off-by: Emanuele Giuseppe Esposito --- docs/devel/testing.rst | 8 1 file changed, 8 insertions(+

Re: [PATCH v3 02/15] python: qemu: pass the wrapper field from QEMUQtestmachine to QEMUMachine

2021-04-30 Thread Max Reitz
testProtocol] = None Reviewed-by: Max Reitz

Re: [PATCH v3 01/15] python: qemu: add timer parameter for qmp.accept socket

2021-04-30 Thread Max Reitz
(+), 1 deletion(-) Reviewed-by: Max Reitz (I would have preferred for the commit message to tell me why we want this (I suspect some later patch is going to use it), but oh well.)

Re: [PATCH] mirror: stop cancelling in-flight requests on non-force cancel in READY

2021-04-30 Thread Max Reitz
On 21.04.21 09:58, Vladimir Sementsov-Ogievskiy wrote: If mirror is READY than cancel operation is not discarding the whole result of the operation, but instead it's a documented way get a point-in-time snapshot of source disk. So, we should not cancel any requests if mirror is READ and force=fa

Re: [PATCH] block: simplify write-threshold and drop write notifiers

2021-04-30 Thread Max Reitz
On 22.04.21 00:09, Vladimir Sementsov-Ogievskiy wrote: write-notifiers are used only for write-threshold. New code for such purpose should create filters. Let's handle write-threshold simply in generic code and drop write notifiers at all. Also move part of write-threshold API that is used only

Re: [PATCH v2] monitor: hmp_qemu_io: acquire aio contex, fix crash

2021-04-30 Thread Max Reitz
need context acquired around blk_unref() as well and actually around blk_insert_bs() too. Let's refactor qemuio_command so that it doesn't acquire aio context but callers do that instead. This way we can cleanly acquire aio context in hmp_qemu_io() around all three calls. Reported-by: Max

Re: [Bug 1925496] Re: nvme disk cannot be hotplugged after removal

2021-04-28 Thread Max Reitz
On 28.04.21 12:12, Klaus Jensen wrote: On Apr 28 09:31, Oguz Bektas wrote: My understanding is that this is the expected behavior. The reason is that the drive cannot be deleted immediately when the device is hot-unplugged, since it might not be safe (other parts of QEMU could be using it, like

Re: [PATCH 1/2] block/export: Free ignored Error

2021-04-26 Thread Max Reitz
On 26.04.21 11:44, Vladimir Sementsov-Ogievskiy wrote: 22.04.2021 17:53, Max Reitz wrote: When invoking block-export-add with some iothread and fixed-iothread=false, and changing the node's iothread fails, the error is supposed to be ignored. However, it is still stored in *errp, whi

[PATCH 0/2] block/export: Fix crash on error after iothread conflict

2021-04-22 Thread Max Reitz
error, we have to free it and clear *errp (with an ERRP_GUARD()). Patch 1 is the fix, patch 2 a regression test. Max Reitz (2): block/export: Free ignored Error iotests/307: Test iothread conflict for exports block/export/export.c | 4 tests/qemu-iotests/307 | 15

[PATCH 2/2] iotests/307: Test iothread conflict for exports

2021-04-22 Thread Max Reitz
. Signed-off-by: Max Reitz --- tests/qemu-iotests/307 | 15 +++ tests/qemu-iotests/307.out | 8 2 files changed, 23 insertions(+) diff --git a/tests/qemu-iotests/307 b/tests/qemu-iotests/307 index c7685347bc..b429b5aa50 100755 --- a/tests/qemu-iotests/307 +++ b/tests

[PATCH 1/2] block/export: Free ignored Error

2021-04-22 Thread Max Reitz
or_setv() fails: qemu-system-x86_64: ../util/error.c:59: error_setv: Assertion `*errp == NULL' failed. So the error from bdrv_try_set_aio_context() must be freed when it is ignored. Fixes: f51d23c80af73c95e0ce703ad06a300f1b3d63ef ("block/export: add iothread and fixed-iothread opt

Re: [PATCH] monitor: hmp_qemu_io: acquire aio contex, fix crash

2021-04-22 Thread Max Reitz
current thread does not own the mutex. So, thread doesn't own the mutex. And we have iothread here. Next, note that AIO_WAIT_WHILE() documents that ctx must be acquired exactly once by caller. But where is it acquired in the call stack? Seems nowhere. qemuio_command do acquire aio context.. But we

Re: [PATCH v4 0/2] Fix segfault in qemu_rbd_parse_filename

2021-04-22 Thread Max Reitz
On 21.04.21 23:23, Connor Kuehl wrote: Connor Kuehl (2): iotests/231: Update expected deprecation message block/rbd: Add an escape-aware strchr helper block/rbd.c| 32 +--- tests/qemu-iotests/231 | 4 tests/qemu-iotests/231.out | 7

[Bug 1563931] Re: qemu-img should allow resizing image with snapshots

2021-04-22 Thread Max Reitz
Implemented in 7fa140abf69675b7b83af32de. Note that every internal snapshot has a disk size associated with it, though, so applying a snapshot from when the image had a different size means the image size will be reverted to what it was as the time of the snapshot. ** Changed in: qemu Stat

[Bug 1721788] Re: Failed to get shared "write" lock with 'qemu-img info'

2021-04-22 Thread Max Reitz
Hi, What exactly is the problem now? As Eric explained in comment 3, "qemu- img info -U" is what needs to be used here. Daniel raised the problem of --force-share/-U being undocumented, but that’s no longer the case as of commit a7e326df1c116e99e, which was first included in the 2.12.0 release.

Re: about mirror cancel

2021-04-16 Thread Max Reitz
On 16.04.21 09:05, Max Reitz wrote: On 15.04.21 20:46, Vladimir Sementsov-Ogievskiy wrote: [...] Note, that if cancelling all in-flight requests on target is wrong on mirror cancel, we still don't have real bug, as the only implementation of .bdrv_cancel_in_flight is stopping reco

Re: about mirror cancel

2021-04-16 Thread Max Reitz
On 15.04.21 20:46, Vladimir Sementsov-Ogievskiy wrote: Hi all! Recently I've implemented fast-cancelling of mirror job: do bdrv_cancel_in_flight() in mirror_cancel(). Now I'm in doubt: is it a correct thing? I heard, that mirror-cancel is a kind of valid mirror completion.. Looking at docu

[PULL 1/1] block/nbd: fix possible use after free of s->connect_thread

2021-04-13 Thread Max Reitz
all this reconnect mess will come soon. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20210406155114.1057355-1-vsement...@virtuozzo.com> Reviewed-by: Roman Kagan Signed-off-by: Max Reitz --- block/nbd.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/block/nbd

[PULL 0/1] Block patch for 6.0-rc3

2021-04-13 Thread Max Reitz
The following changes since commit dce628a97fde2594f99d738883a157f05aa0a14f: Merge remote-tracking branch 'remotes/dg-gitlab/tags/ppc-for-6.0-20210412' into staging (2021-04-13 13:05:07 +0100) are available in the Git repository at: https://github.com/XanClic/qemu.git tags/pull-block-2021-0

Re: [PATCH for-6.0] block/nbd: fix possible use after free of s->connect_thread

2021-04-13 Thread Max Reitz
On 13.04.21 14:19, Vladimir Sementsov-Ogievskiy wrote: 13.04.2021 14:53, Max Reitz wrote: On 06.04.21 17:51, Vladimir Sementsov-Ogievskiy wrote: If on nbd_close() we detach the thread (in nbd_co_establish_connection_cancel() thr->state becomes CONNECT_THREAD_RUNNING_DETACHED), after that po

Re: [PATCH for-6.0] block/nbd: fix possible use after free of s->connect_thread

2021-04-13 Thread Max Reitz
On 06.04.21 17:51, Vladimir Sementsov-Ogievskiy wrote: If on nbd_close() we detach the thread (in nbd_co_establish_connection_cancel() thr->state becomes CONNECT_THREAD_RUNNING_DETACHED), after that point we should not use s->connect_thread (which is set to NULL), as running thread may free it at

Re: [PATCH v2 2/2] block/rbd: Add an escape-aware strchr helper

2021-04-09 Thread Max Reitz
On 09.04.21 16:05, Connor Kuehl wrote: On 4/6/21 9:24 AM, Max Reitz wrote: On 01.04.21 23:01, Connor Kuehl wrote: [..] diff --git a/block/rbd.c b/block/rbd.c index 9071a00e3f..c0e4d4a952 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -134,6 +134,22 @@ static char *qemu_rbd_next_tok(char *src

Re: [PATCH v2 3/3] iotests/041: block-job-complete on user-paused job

2021-04-09 Thread Max Reitz
On 09.04.21 15:29, Max Reitz wrote: Expand test_pause() to check what happens when issuing block-job-complete on a job that is on STANDBY because it has been paused by the user. (This should be an error, and in particular not hang job_wait_unpaused().) Signed-off-by: Max Reitz --- tests

[PATCH v2 4/3] iotests: Test completion immediately after drain

2021-04-09 Thread Max Reitz
Test what happens when you have multiple busy block jobs, drain all (via an empty transaction), and immediately issue a block-job-complete on one of the jobs. Sometimes it will still be in STANDBY, in which case block-job-complete used to fail. It should not. Signed-off-by: Max Reitz

[PATCH v2 3/3] iotests/041: block-job-complete on user-paused job

2021-04-09 Thread Max Reitz
Expand test_pause() to check what happens when issuing block-job-complete on a job that is on STANDBY because it has been paused by the user. (This should be an error, and in particular not hang job_wait_unpaused().) Signed-off-by: Max Reitz --- tests/qemu-iotests/041 | 13 - 1

[PATCH v2 2/3] test-blockjob: Test job_wait_unpaused()

2021-04-09 Thread Max Reitz
Create a job that remains on STANDBY after a drained section, and see that invoking job_wait_unpaused() will get it unstuck. Signed-off-by: Max Reitz --- tests/unit/test-blockjob.c | 140 + 1 file changed, 140 insertions(+) diff --git a/tests/unit/test

[PATCH v2 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-09 Thread Max Reitz
error when job->pause_point > 0. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1945635 Signed-off-by: Max Reitz --- include/qemu/job.h | 15 + blockdev.c | 3 +++ job.c | 53 ++ 3 files changed, 71 inse

[PATCH v2 0/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-09 Thread Max Reitz
'job: Add job_wait_unpaused() for block-job-complete' 002/4:[] [--] 'test-blockjob: Test job_wait_unpaused()' 003/4:[] [--] 'iotests/041: block-job-complete on user-paused job' 004/4:[down] 'iotests: Test completion immediately after drain' Max Reitz

[PATCH 3/4] job: Allow complete for jobs on standby

2021-04-09 Thread Max Reitz
The only job that implements .complete is the mirror job, and it can handle completion requests just fine while the job is paused. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1945635 Signed-off-by: Max Reitz --- job.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH 2/4] mirror: Do not enter a paused job on completion

2021-04-09 Thread Max Reitz
paused. So technically this is a no-op, but obviously the intention is to accept block-job-complete even for jobs on standby, which we need this patch for first. Signed-off-by: Max Reitz --- block/mirror.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/block/mirror.c b

[PATCH 4/4] test-blockjob: Test job_wait_unpaused()

2021-04-09 Thread Max Reitz
Create a job that remains on STANDBY after a drained section, and see that invoking job_wait_unpaused() will get it unstuck. Signed-off-by: Max Reitz --- tests/unit/test-blockjob.c | 121 + 1 file changed, 121 insertions(+) diff --git a/tests/unit/test

[PATCH 5/4] iotests: Test completion immediately after drain

2021-04-09 Thread Max Reitz
Test what happens when you have multiple busy block jobs, drain all (via an empty transaction), and immediately issue a block-job-complete on one of the jobs. Sometimes it will still be in STANDBY, in which case block-job-complete used to fail. It should not. Signed-off-by: Max Reitz

[PATCH 1/4] mirror: Move open_backing_file to exit_common

2021-04-09 Thread Max Reitz
This is a graph change and therefore should be done in job-finalize (which is what invokes mirror_exit_common()). Signed-off-by: Max Reitz --- block/mirror.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index

[PATCH 0/4] job: Allow complete for jobs on standby

2021-04-09 Thread Max Reitz
job_complete() refuses to do anything). I’m not sure we want that iotest, because it does quite a bit of I/O and it’s unreliable, and I don’t think there’s anything I can do to make it reliable. Max Reitz (5): mirror: Move open_backing_file to exit_common mirror: Do not enter a paused job on

Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-09 Thread Max Reitz
On 09.04.21 12:07, Vladimir Sementsov-Ogievskiy wrote: 09.04.2021 12:51, Max Reitz wrote: On 08.04.21 19:26, Vladimir Sementsov-Ogievskiy wrote: 08.04.2021 20:04, John Snow wrote: On 4/8/21 12:58 PM, Vladimir Sementsov-Ogievskiy wrote: job-complete command is async. Can we instead just add a

Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-09 Thread Max Reitz
On 09.04.21 11:44, Kevin Wolf wrote: Am 08.04.2021 um 18:55 hat John Snow geschrieben: On 4/8/21 12:20 PM, Max Reitz wrote: block-job-complete can only be applied when the job is READY, not when it is on STANDBY (ready, but paused). Draining a job technically pauses it (which makes a READY

Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-09 Thread Max Reitz
On 08.04.21 19:26, Vladimir Sementsov-Ogievskiy wrote: 08.04.2021 20:04, John Snow wrote: On 4/8/21 12:58 PM, Vladimir Sementsov-Ogievskiy wrote: job-complete command is async. Can we instead just add a boolean like job->completion_requested, and set it if job-complete called in STANDBY state,

Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-09 Thread Max Reitz
On 08.04.21 18:58, Vladimir Sementsov-Ogievskiy wrote: 08.04.2021 19:20, Max Reitz wrote: block-job-complete can only be applied when the job is READY, not when it is on STANDBY (ready, but paused).  Draining a job technically pauses it (which makes a READY job enter STANDBY), and ending the

Re: [PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-09 Thread Max Reitz
On 08.04.21 18:55, John Snow wrote: On 4/8/21 12:20 PM, Max Reitz wrote: block-job-complete can only be applied when the job is READY, not when it is on STANDBY (ready, but paused).  Draining a job technically pauses it (which makes a READY job enter STANDBY), and ending the drained section

[PATCH for-6.0? 0/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-08 Thread Max Reitz
have as part of the iotests. Instead, I opted for a unit test, which allows me to cheat a bit (specifically, locking the job IO thread before ending the drained section). Max Reitz (3): job: Add job_wait_unpaused() for block-job-complete test-blockjob: Test job_wait_unpaused() iotests/041

[PATCH for-6.0? 2/3] test-blockjob: Test job_wait_unpaused()

2021-04-08 Thread Max Reitz
Create a job that remains on STANDBY after a drained section, and see that invoking job_wait_unpaused() will get it unstuck. Signed-off-by: Max Reitz --- tests/unit/test-blockjob.c | 140 + 1 file changed, 140 insertions(+) diff --git a/tests/unit/test

[PATCH for-6.0? 1/3] job: Add job_wait_unpaused() for block-job-complete

2021-04-08 Thread Max Reitz
then. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1945635 Signed-off-by: Max Reitz --- include/qemu/job.h | 15 +++ blockdev.c | 3 +++ job.c | 42 ++ 3 files changed, 60 insertions(+) diff --git a/include/qemu

[PATCH for-6.0? 3/3] iotests/041: block-job-complete on user-paused job

2021-04-08 Thread Max Reitz
Expand test_pause() to check what happens when issuing block-job-complete on a job that is on STANDBY because it has been paused by the user. (This should be an error, and in particular not hang job_wait_unpaused().) Signed-off-by: Max Reitz --- tests/qemu-iotests/041 | 13 - 1

Re: [PATCH v4 09/23] job: call job_enter from job_pause

2021-04-07 Thread Max Reitz
On 16.01.21 22:46, Vladimir Sementsov-Ogievskiy wrote: If main job coroutine called job_yield (while some background process is in progress), we should give it a chance to call job_pause_point(). It will be used in backup, when moved on async block-copy. Note, that job_user_pause is not enough:

Re: [PATCH 0/2] block/rbd: fix memory leaks

2021-04-06 Thread Max Reitz
file changed, 6 insertions(+), 4 deletions(-) Reviewed-by: Max Reitz I’m not quite sure whether this is fit for 6.0... I think it’s too late for rc2, so I don’t know. Max

Re: [PATCH v2 2/2] block/rbd: Add an escape-aware strchr helper

2021-04-06 Thread Max Reitz
On 01.04.21 23:01, Connor Kuehl wrote: Sometimes the parser needs to further split a token it has collected from the token input stream. Right now, it does a cursory check to see if the relevant characters appear in the token to determine if it should break it down further. However, qemu_rbd_nex

Re: [PATCH 2/2] block/rbd: Don't unescape in qemu_rbd_next_tok()

2021-04-01 Thread Max Reitz
On 01.04.21 17:52, Connor Kuehl wrote: That's qemu_rbd_unescape()'s job! No need to duplicate the labor. Furthermore, this was causing some confusion in the parsing logic to where the caller might test for the presence of a character to split on like so: if (strchr(image_name, '/')) {

Re: [PATCH 1/2] iotests/231: Update expected deprecation message

2021-04-01 Thread Max Reitz
On 01.04.21 18:52, Max Reitz wrote: On 01.04.21 17:52, Connor Kuehl wrote: The deprecation message changed slightly at some point in the past but the expected output wasn't updated along with it; causing it to fail. Fix it, so it passes. Signed-off-by: Connor Kuehl ---   tests/qemu-io

Re: [PATCH 1/2] iotests/231: Update expected deprecation message

2021-04-01 Thread Max Reitz
On 01.04.21 17:52, Connor Kuehl wrote: The deprecation message changed slightly at some point in the past but the expected output wasn't updated along with it; causing it to fail. Fix it, so it passes. Signed-off-by: Connor Kuehl --- tests/qemu-iotests/231.out | 4 +--- 1 file changed, 1 ins

Re: [PATCH] iotests/qsd-jobs: Filter events in the first test

2021-04-01 Thread Max Reitz
On 01.04.21 16:37, Vladimir Sementsov-Ogievskiy wrote: 01.04.2021 17:37, Vladimir Sementsov-Ogievskiy wrote: 01.04.2021 16:28, Max Reitz wrote: The job may or may not be ready before the 'quit' is issued.  Whether it is is irrelevant; for the purpose of the test, it only needs t

Re: [PATCH 2/2] iotests/qsd-jobs: Use common.qemu for the QSD

2021-04-01 Thread Max Reitz
On 01.04.21 16:44, Vladimir Sementsov-Ogievskiy wrote: 01.04.2021 16:28, Max Reitz wrote: Using common.qemu allows us to wait for specific replies, so we can for example wait for events.  This allows starting the active commit job and then wait for it to be ready before quitting the QSD, so we

[PATCH] iotests/qsd-jobs: Filter events in the first test

2021-04-01 Thread Max Reitz
: Vladimir Sementsov-Ogievskiy Signed-off-by: Max Reitz --- This is an alternative to "iotests/qsd-jobs: Use common.qemu for the QSD". I can't disagree with Vladimir that perhaps this test just should not care about the job status events, because all that matters is that the job is sti

[PATCH 2/2] iotests/qsd-jobs: Use common.qemu for the QSD

2021-04-01 Thread Max Reitz
in qsd-jobs, but we might as well make the second one use common.qemu's infrastructure, too.) Reported-by: Peter Maydell Signed-off-by: Max Reitz --- tests/qemu-iotests/tests/qsd-jobs | 55 --- tests/qemu-iotests/tests/qsd-jobs.out | 10 - 2 files change

[PATCH 1/2] iotests/common.qemu: Allow using the QSD

2021-04-01 Thread Max Reitz
For block things, we often do not need to run all of qemu, so allow using the qemu-storage-daemon instead. Signed-off-by: Max Reitz --- tests/qemu-iotests/common.qemu | 53 +++--- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/tests/qemu-iotests

[PATCH 0/2] iotests/qsd-jobs: Use common.qemu for the QSD

2021-04-01 Thread Max Reitz
might want to fix qsd-jobs in 6.0. Max Reitz (2): iotests/common.qemu: Allow using the QSD iotests/qsd-jobs: Use common.qemu for the QSD tests/qemu-iotests/common.qemu| 53 +- tests/qemu-iotests/tests/qsd-jobs | 55 --- tests/qemu

Re: [PATCH] iotests: Test mirror-top filter permissions

2021-04-01 Thread Max Reitz
On 01.04.21 10:32, Vladimir Sementsov-Ogievskiy wrote: 31.03.2021 15:28, Max Reitz wrote: Add a test accompanying commit 53431b9086b2832ca1aeff0c55e186e9ed79bd11 ("block/mirror: Fix mirror_top's permissions"). Signed-off-by: Max Reitz ---   tests/qemu-iotests/tests/mirror-top-

Re: [RFC PATCH] block: always update auto_backing_file to full path

2021-04-01 Thread Max Reitz
On 01.04.21 06:22, Joe Jin wrote: Some time after created snapshot, auto_backing_file only has filename, this confused overridden check, update it to full path if it is not. Signed-off-by: Joe Jin ---  block.c | 13 +  1 file changed, 13 insertions(+) Do you have a test for this?

[PATCH] iotests: Test mirror-top filter permissions

2021-03-31 Thread Max Reitz
Add a test accompanying commit 53431b9086b2832ca1aeff0c55e186e9ed79bd11 ("block/mirror: Fix mirror_top's permissions"). Signed-off-by: Max Reitz --- tests/qemu-iotests/tests/mirror-top-perms | 121 ++ tests/qemu-iotests/tests/mirror-top-perms.out | 5 +

Re: [PATCH 2/4] migrate-bitmaps-postcopy-test: Fix pylint warnings

2021-03-30 Thread Max Reitz
On 30.03.21 18:47, Vladimir Sementsov-Ogievskiy wrote: 29.03.2021 16:26, Max Reitz wrote: pylint complains that discards1_sha256 and all_discards_sha256 are first set in non-__init__ methods.  Let's make it happy. Signed-off-by: Max Reitz ---   tests/qemu-iotests/tests/migrate-bi

Re: [PATCH v4 for-6.0? 0/3] qcow2: fix parallel rewrite and discard (rw-lock)

2021-03-30 Thread Max Reitz
On 30.03.21 15:25, Vladimir Sementsov-Ogievskiy wrote: 30.03.2021 15:51, Max Reitz wrote: On 30.03.21 12:51, Vladimir Sementsov-Ogievskiy wrote: 30.03.2021 12:49, Max Reitz wrote: On 25.03.21 20:12, Vladimir Sementsov-Ogievskiy wrote: ping. Do we want it for 6.0? I’d rather wait.  I think

[PULL 9/9] iotests/244: Test preallocation for data-file-raw

2021-03-30 Thread Max Reitz
case, because without the L2 tables preallocated, all clusters would appear as unallocated, and so the qcow2 driver would fall through to the backing file.) Signed-off-by: Max Reitz Message-Id: <20210326145509.163455-3-mre...@redhat.com> Reviewed-by: Eric Blake --- tests/qemu-iotes

[PULL 8/9] qcow2: Force preallocation with data-file-raw

2021-03-30 Thread Max Reitz
data area. Signed-off-by: Max Reitz Message-Id: <20210326145509.163455-2-mre...@redhat.com> Reviewed-by: Eric Blake --- block/qcow2.c | 34 ++ tests/qemu-iotests/244.out | 9 - 2 files changed, 38 insertions(+), 5 deletions(-) diff --

Re: [PATCH v4 for-6.0? 0/3] qcow2: fix parallel rewrite and discard (rw-lock)

2021-03-30 Thread Max Reitz
On 30.03.21 12:51, Vladimir Sementsov-Ogievskiy wrote: 30.03.2021 12:49, Max Reitz wrote: On 25.03.21 20:12, Vladimir Sementsov-Ogievskiy wrote: ping. Do we want it for 6.0? I’d rather wait.  I think the conclusion was that guests shouldn’t hit this because they serialize discards? I

[PULL 5/9] iotests/046: Filter request length

2021-03-30 Thread Max Reitz
request), the test fails (for no good reason). Filter the length, too. Signed-off-by: Max Reitz Message-Id: <20200918153323.108932-1-mre...@redhat.com> --- tests/qemu-iotests/046 | 3 +- tests/qemu-iotests/046.out | 104 ++--- 2 files changed, 54 inse

[PULL 2/9] iotests: fix 051.out expected output after error text touchups

2021-03-30 Thread Max Reitz
: Clarify error messages pertaining to 'node-name'") Signed-off-by: Connor Kuehl Message-Id: <20210318200949.1387703-2-cku...@redhat.com> Tested-by: Christian Borntraeger Reviewed-by: John Snow Signed-off-by: Max Reitz --- tests/qemu-iotests/051.out | 6 +++--- 1 file changed, 3

[PULL 7/9] qsd: Document FUSE exports

2021-03-30 Thread Max Reitz
Implementing FUSE exports required no changes to the storage daemon, so we forgot to document them there. Considering that both NBD and vhost-user-blk exports are documented in its man page (and NBD exports in its --help text), we should probably do the same for FUSE. Signed-off-by: Max Reitz

[PULL 4/9] qcow2: use external virtual timers

2021-03-30 Thread Max Reitz
adds external flag to the timer for qcow2 cache clean. Signed-off-by: Pavel Dovgalyuk Reviewed-by: Paolo Bonzini Message-Id: <161700516327.1141158.8366564693714562536.stgit@pasha-ThinkPad-X280> Signed-off-by: Max Reitz --- block/qcow2.c | 7 --- 1 file changed, 4 insertions(+), 3 deletio

[PULL 6/9] block/mirror: Fix mirror_top's permissions

2021-03-30 Thread Max Reitz
all images in the backing chain, so the mirror job can take it for the target BB). Signed-off-by: Max Reitz Message-Id: <20210211172242.146671-2-mre...@redhat.com> Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/mirror.c | 32 +---

[PULL 1/9] iotests: Fix typo in iotest 051

2021-03-30 Thread Max Reitz
From: Tao Xu There is an typo in iotest 051, correct it. Signed-off-by: Tao Xu Message-Id: <20210324084321.90952-1-tao3...@intel.com> Signed-off-by: Max Reitz --- tests/qemu-iotests/051| 2 +- tests/qemu-iotests/051.pc.out | 4 ++-- 2 files changed, 3 insertions(+), 3 del

[PULL 3/9] iotests/116: Fix reference output

2021-03-30 Thread Max Reitz
ils. Let's fix the reference output, which has the nice side effect of demonstrating 15ce94a68ca's improvements. Fixes: 15ce94a68ca6730466c565c3d29971aab3087bf1 ("block/qed: bdrv_qed_do_open: deal with errp") Signed-off-by: Max Reitz Message-Id: <20210326141419.15683

[PULL 0/9] Block patches for 6.0-rc1

2021-03-30 Thread Max Reitz
all metadata structures should be preallocated - iotest fixes Connor Kuehl (1): iotests: fix 051.out expected output after error text touchups Max Reitz (6): iotests/116: Fix reference output iotests/046: Filter request

Re: [PATCH v3 0/5] qemu-iotests: quality of life improvements

2021-03-30 Thread Max Reitz
On 30.03.21 13:32, Max Reitz wrote: On 26.03.21 15:23, Paolo Bonzini wrote: This series adds a few usability improvements to qemu-iotests, in particular: - arguments can be passed to Python unittests scripts, for example    to run only a subset of the test cases (patches 1-2) - it is possible

Re: [PATCH v3 0/5] qemu-iotests: quality of life improvements

2021-03-30 Thread Max Reitz
On 26.03.21 15:23, Paolo Bonzini wrote: This series adds a few usability improvements to qemu-iotests, in particular: - arguments can be passed to Python unittests scripts, for example to run only a subset of the test cases (patches 1-2) - it is possible to do "./check -- ../../../tests/qemu

Re: [PATCH v2 0/2] qcow2: Force preallocation with data-file-raw

2021-03-30 Thread Max Reitz
On 26.03.21 15:55, Max Reitz wrote: v1: https://lists.nongnu.org/archive/html/qemu-block/2020-06/msg00992.html Hi, I think that qcow2 images with data-file-raw should always have preallocated 1:1 L1/L2 tables, so that the image always looks the same whether you respect or ignore the qcow2

Re: [PATCH v3 4/5] qemu-iotests: let "check" spawn an arbitrary test command

2021-03-30 Thread Max Reitz
On 30.03.21 12:44, Max Reitz wrote: On 30.03.21 12:38, Max Reitz wrote: On 26.03.21 16:05, Max Reitz wrote: On 26.03.21 15:23, Paolo Bonzini wrote: Right now there is no easy way for "check" to print a reproducer command. Because such a reproducer command line would be huge, we c

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