[PATCH v6 04/15] test-bdrv-graph-mod: update test_parallel_perm_update test case

2022-06-24 Thread Vladimir Sementsov-Ogievskiy
e are going to formalize this rule, so let's better use DATA children here. 3. It creates more than one FILTERED child, which is already abandoned in BDRV_CHILD_FILTERED's description. While being here, update the picture to better correspond to the test code. Signed-off-by: Vladimi

[PATCH v6 06/15] test-bdrv-graph-mod: fix filters to be filters

2022-06-24 Thread Vladimir Sementsov-Ogievskiy
ldren. bdrv_exclusive_writer is used as a filter once. So it should be filter anyway. We want to append it, so it should be backing-child-based fitler too. Make all FILTERED children to be PRIMARY as well. We are going to force this rule by assertion soon. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by:

[PATCH v6 05/15] tests-bdrv-drain: bdrv_replace_test driver: declare supports_backing

2022-06-24 Thread Vladimir Sementsov-Ogievskiy
ld in generic code. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- tests/unit/test-bdrv-drain.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/test-bdrv-drain.c b/tests/unit/test-bdrv-drain.c index 36be84ae55..23d425a494 100644 --- a/tests/unit/test-bdrv-d

[PATCH v6 00/15] block: cleanup backing and file handling

2022-06-24 Thread Vladimir Sementsov-Ogievskiy
on't keep **child indirection, move to just returning a child ptr (honestly, I didn't analyze all the callers do they need this int value. Do you think it's needed?) - handle snapshot-access.c 14: get rid of _ptr 15: update comment Vladimir Sementsov-Ogievskiy (15

[PATCH v6 03/15] block/blklogwrites: don't care to remove bs->file child on failure

2022-06-24 Thread Vladimir Sementsov-Ogievskiy
We don't need to remove bs->file, generic layer takes care of it. No other driver cares to remove bs->file on failure by hand. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- block/blklogwrites.c | 4 1 file changed, 4 deletions(-) diff --

[PATCH v6 01/15] block: BlockDriver: add .filtered_child_is_backing field

2022-06-24 Thread Vladimir Sementsov-Ogievskiy
igned-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- block/commit.c | 1 + block/mirror.c | 1 + include/block/block_int-common.h | 13 + 3 files changed, 15 insertions(+) diff --git a/block/commit.c b/block/commit.c index 851d1

[PATCH] python: QEMUMachine: enable qmp accept timeout by default

2022-06-24 Thread Vladimir Sementsov-Ogievskiy
nts. Qemu fails and we wait for qmp accept endlessly. In gitlab it's just stopped by timeout (one hour) with no sign of what's going wrong. With timeout enabled, gitlab don't wait for an hour and prints all needed information. Signed-off-by: Vladimir Sementsov-Ogievskiy --- Hi a

Re: [PATCH v7 01/18] job.c: make job_mutex and job_lock/unlock() public

2022-06-24 Thread Vladimir Sementsov-Ogievskiy
I've already acked this (honestly, because Stefan do), but still, want to clarify: On 6/16/22 16:18, Emanuele Giuseppe Esposito wrote: job mutex will be used to protect the job struct elements and list, replacing AioContext locks. Right now use a shared lock for all jobs, in order to keep thin

Re: [PATCH v7 10/18] jobs: rename static functions called with job_mutex held

2022-06-23 Thread Vladimir Sementsov-Ogievskiy
On 6/23/22 14:19, Emanuele Giuseppe Esposito wrote: Am 23/06/2022 um 13:10 schrieb Vladimir Sementsov-Ogievskiy: On 6/23/22 12:08, Emanuele Giuseppe Esposito wrote: Am 22/06/2022 um 20:38 schrieb Vladimir Sementsov-Ogievskiy: On 6/22/22 17:26, Emanuele Giuseppe Esposito wrote: Am 21/06

Re: [PATCH v7 10/18] jobs: rename static functions called with job_mutex held

2022-06-23 Thread Vladimir Sementsov-Ogievskiy
On 6/23/22 12:08, Emanuele Giuseppe Esposito wrote: Am 22/06/2022 um 20:38 schrieb Vladimir Sementsov-Ogievskiy: On 6/22/22 17:26, Emanuele Giuseppe Esposito wrote: Am 21/06/2022 um 19:26 schrieb Vladimir Sementsov-Ogievskiy: On 6/16/22 16:18, Emanuele Giuseppe Esposito wrote: With the

Re: [PATCH v7 10/18] jobs: rename static functions called with job_mutex held

2022-06-22 Thread Vladimir Sementsov-Ogievskiy
On 6/22/22 17:26, Emanuele Giuseppe Esposito wrote: Am 21/06/2022 um 19:26 schrieb Vladimir Sementsov-Ogievskiy: On 6/16/22 16:18, Emanuele Giuseppe Esposito wrote: With the*nop*  job_lock/unlock placed, rename the static functions that are always under job_mutex, adding "_locked&qu

Re: [PATCH v7 05/18] job.h: add _locked duplicates for job API functions called with and without job_mutex

2022-06-22 Thread Vladimir Sementsov-Ogievskiy
On 6/22/22 17:26, Emanuele Giuseppe Esposito wrote: Am 21/06/2022 um 17:03 schrieb Vladimir Sementsov-Ogievskiy: On 6/16/22 16:18, Emanuele Giuseppe Esposito wrote: In preparation to the job_lock/unlock usage, create _locked duplicates of some functions, since they will be sometimes called

Re: [PATCH v7 10/18] jobs: rename static functions called with job_mutex held

2022-06-21 Thread Vladimir Sementsov-Ogievskiy
On 6/16/22 16:18, Emanuele Giuseppe Esposito wrote: With the*nop* job_lock/unlock placed, rename the static functions that are always under job_mutex, adding "_locked" suffix. List of functions that get this suffix: job_txn_refjob_txn_del_job job_txn_apply job_state

Re: [PATCH v7 06/18] jobs: protect jobs with job_lock/unlock

2022-06-21 Thread Vladimir Sementsov-Ogievskiy
On 6/16/22 16:18, Emanuele Giuseppe Esposito wrote: } @@ -1939,7 +1943,9 @@ static void blockdev_backup_abort(BlkActionState *common) aio_context = bdrv_get_aio_context(state->bs); aio_context_acquire(aio_context); -job_cancel_sync(&state->job->job, true); +

Re: [PATCH v7 06/18] jobs: protect jobs with job_lock/unlock

2022-06-21 Thread Vladimir Sementsov-Ogievskiy
On 6/16/22 16:18, Emanuele Giuseppe Esposito wrote: Introduce the job locking mechanism through the whole job API, Not the whole, I think? As next patches introduces locking in more and more places.. -- Best regards, Vladimir

Re: [PATCH v7 05/18] job.h: add _locked duplicates for job API functions called with and without job_mutex

2022-06-21 Thread Vladimir Sementsov-Ogievskiy
On 6/16/22 16:18, Emanuele Giuseppe Esposito wrote: In preparation to the job_lock/unlock usage, create _locked duplicates of some functions, since they will be sometimes called with job_mutex held (mostly within job.c), and sometimes without (mostly from JobDrivers using the job API). Therefore

Re: [PATCH v7 04/18] aio-wait.h: introduce AIO_WAIT_WHILE_UNLOCKED

2022-06-21 Thread Vladimir Sementsov-Ogievskiy
nuele Giuseppe Esposito A bit strange that you put r-b marks above your s-o-b. Usually, marks goes in historical order: 1. your s-o-b 2. reviewers r-b marks 3. maintainer's s-o-b mark Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v7 03/18] job.c: API functions not used outside should be static

2022-06-21 Thread Vladimir Sementsov-Ogievskiy
On 6/16/22 16:18, Emanuele Giuseppe Esposito wrote: job_event_* functions can all be static, as they are not used outside job.c. Same applies for job_txn_add_job(). Reviewed-by: Stefan Hajnoczi Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best

Re: [PATCH v7 02/18] job.h: categorize fields in struct Job

2022-06-21 Thread Vladimir Sementsov-Ogievskiy
opped 1-2 last hunks: Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v7 01/18] job.c: make job_mutex and job_lock/unlock() public

2022-06-21 Thread Vladimir Sementsov-Ogievskiy
noczi Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v5 29/45] block: introduce BDRV_O_NOPERM flag

2022-06-21 Thread Vladimir Sementsov-Ogievskiy
On 6/13/22 12:54, Hanna Reitz wrote: On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: Now copy-before-write filter has weak permission model: when it has no parents, it share write permission on source. Otherwise we just can't blockdev-add it, when existing user of source has

Re: [PATCH v5 21/45] block: add bdrv_try_set_aio_context_tran transaction action

2022-06-21 Thread Vladimir Sementsov-Ogievskiy
On 6/21/22 14:04, Hanna Reitz wrote: On 20.06.22 22:57, Vladimir Sementsov-Ogievskiy wrote: On 6/13/22 10:46, Hanna Reitz wrote: On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: To be used in further commit. Signed-off-by: Vladimir Sementsov-Ogievskiy ---   block.c | 48

Re: [PATCH v5 22/45] block: implemet bdrv_unref_tran()

2022-06-20 Thread Vladimir Sementsov-Ogievskiy
On 6/13/22 12:07, Hanna Reitz wrote: On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: Now nodes are removed during block-graph update transactions now? Look at bdrv_replace_child_tran: bdrv_unref() is simply postponed to commit phase. What is the problem with it? We want to make copy

Re: [PATCH v5 21/45] block: add bdrv_try_set_aio_context_tran transaction action

2022-06-20 Thread Vladimir Sementsov-Ogievskiy
On 6/13/22 10:46, Hanna Reitz wrote: On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: To be used in further commit. Signed-off-by: Vladimir Sementsov-Ogievskiy ---   block.c | 48   1 file changed, 48 insertions(+) diff --git a/block.c b

Re: [PULL 00/10] Block jobs & NBD patches

2022-06-15 Thread Vladimir Sementsov-Ogievskiy
On 6/14/22 21:05, Richard Henderson wrote: On 6/14/22 03:29, Vladimir Sementsov-Ogievskiy wrote: The following changes since commit debd0753663bc89c86f5462a53268f2e3f680f60:    Merge tag 'pull-testing-next-140622-1' of https://github.com/stsquad/qemu into staging (2022-06-13 21:1

[PULL 06/10] block/copy-before-write: implement cbw-timeout option

2022-06-14 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy In some scenarios, when copy-before-write operations lasts too long time, it's better to cancel it. Most useful would be to use the new option together with on-cbw-error=break-snapshot: this way if cbw operation takes too long time we'll just can

[PULL 05/10] block/block-copy: block_copy(): add timeout_ns parameter

2022-06-14 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy Add possibility to limit block_copy() call in time. To be used in the next commit. As timed-out block_copy() call will continue in background anyway (we can't immediately cancel IO operation), it's important also give user a possibility to pass a ca

[PULL 10/10] MAINTAINERS: update Vladimir's address and repositories

2022-06-14 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- MAINTAINERS | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 0df25ed4b0..9e37bfe279 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2538,7 +2538,7 @@ F: scsi/* Block Jobs

[PULL 08/10] nbd: trace long NBD operations

2022-06-14 Thread Vladimir Sementsov-Ogievskiy
add trace points for them. This patch is based on the original downstream work made by Vladimir. Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Vladimir Sementsov-Ogievskiy CC: Kevin Wolf CC: Hanna Reitz CC: Paolo Bonzini Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir

[PULL 09/10] block: use 'unsigned' for in_flight field on driver state

2022-06-14 Thread Vladimir Sementsov-Ogievskiy
: Vladimir Sementsov-Ogievskiy CC: Kevin Wolf CC: Hanna Reitz CC: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/mirror.c | 2 +- block/nbd.c| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/block/mirror.c b/

[PULL 03/10] iotests: add copy-before-write: on-cbw-error tests

2022-06-14 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy Add tests for new option of copy-before-write filter: on-cbw-error. Note that we use QEMUMachine instead of VM class, because in further commit we'll want to use throttling which doesn't work with -accel qtest used by VM. We also touch pylintrc to

[PULL 04/10] util: add qemu-co-timeout

2022-06-14 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy Add new API, to make a time limited call of the coroutine. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/qemu/coroutine.h | 13 ++ util/meson.build | 1 + util/qemu

[PULL 07/10] iotests: copy-before-write: add cases for cbw-timeout option

2022-06-14 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy Add two simple test-cases: timeout failure with break-snapshot-on-cbw-error behavior and similar with break-guest-write-on-cbw-error behavior. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Signed-off-by: Vladimir Sementsov-Ogievskiy

[PULL 00/10] Block jobs & NBD patches

2022-06-14 Thread Vladimir Sementsov-Ogievskiy
new address and new expire time. Updated key is here: https://keys.openpgp.org/search?q=vsementsov%40yandex-team.ru Denis V. Lunev (2): nbd: trace long NBD operations block: use 'unsigned' for in_flight field on driver

[PULL 01/10] block/copy-before-write: refactor option parsing

2022-06-14 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy We are going to add one more option of enum type. Let's refactor option parsing so that we can simply work with BlockdevOptionsCbw object. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz Signed-off-by: Vladimir Sementsov-Ogie

[PULL 02/10] block/copy-before-write: add on-cbw-error open parameter

2022-06-14 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy Currently, behavior on copy-before-write operation failure is simple: report error to the guest. Let's implement alternative behavior: break the whole copy-before-write process (and corresponding backup job or NBD client) but keep guest working. It's

Re: [PATCH 1/1] block: use 'unsigned' for in_flight field on driver state

2022-06-14 Thread Vladimir Sementsov-Ogievskiy
hn Snow CC: Vladimir Sementsov-Ogievskiy CC: Kevin Wolf CC: Hanna Reitz CC: Eric Blake Thanks, applied to my block branch at https://gitlab.com/vsementsov/qemu/-/commits/block -- Best regards, Vladimir

Re: [PATCH v2 1/1] nbd: trace long NBD operations

2022-06-14 Thread Vladimir Sementsov-Ogievskiy
to add trace points for them. This patch is based on the original downstream work made by Vladimir. Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Vladimir Sementsov-Ogievskiy CC: Kevin Wolf CC: Hanna Reitz CC: Paolo Bonzini Thanks, applied to my block branch at https://gitlab.com/vsementsov

Re: [PATCH v5 21/45] block: add bdrv_try_set_aio_context_tran transaction action

2022-06-09 Thread Vladimir Sementsov-Ogievskiy
On 6/8/22 14:49, Hanna Reitz wrote: On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: To be used in further commit. Signed-off-by: Vladimir Sementsov-Ogievskiy ---   block.c | 48   1 file changed, 48 insertions(+) Looking at

Re: [PATCH v5 14/45] block/snapshot: drop indirection around bdrv_snapshot_fallback_ptr

2022-06-09 Thread Vladimir Sementsov-Ogievskiy
On 6/7/22 18:58, Hanna Reitz wrote: On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: Now the indirection is not actually used, we can safely reduce it to simple pointer. Signed-off-by: Vladimir Sementsov-Ogievskiy ---   block/snapshot.c | 39 +--   1

Re: [PATCH v4 0/7] copy-before-write: on-cbw-error and cbw-timeout

2022-06-09 Thread Vladimir Sementsov-Ogievskiy
On 5/26/22 21:51, Vladimir Sementsov-Ogievskiy wrote: On 5/26/22 19:46, Vladimir Sementsov-Ogievskiy wrote: On 4/7/22 16:27, Vladimir Sementsov-Ogievskiy wrote: Hi all! v4: Now based on master 01: add assertion and r-b 02: s/7.0/7.1/ and r-b 03: switch to QEMUMachine, touch-up pylintrc,  drop

Re: [PATCH v5 04/45] test-bdrv-graph-mod: update test_parallel_perm_update test case

2022-06-09 Thread Vladimir Sementsov-Ogievskiy
On 6/7/22 13:53, Hanna Reitz wrote: On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: test_parallel_perm_update() does two things that we are going to restrict in the near future: 1. It updates bs->file field by hand. bs->file will be managed     automatically by generic code (to

Re: [PATCH v5 13/45] block: Manipulate bs->file / bs->backing pointers in .attach/.detach

2022-06-09 Thread Vladimir Sementsov-Ogievskiy
On 6/7/22 18:55, Hanna Reitz wrote: On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: bs->file and bs->backing are a kind of duplication of part of bs->children. But very useful diplication, so let's not drop them at all:) We should manage bs->file and bs->backing in

Re: [PATCH v5 09/45] Revert "block: Let replace_child_noperm free children"

2022-06-07 Thread Vladimir Sementsov-Ogievskiy
On 6/7/22 17:03, Hanna Reitz wrote: On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: We are going to reimplement this behavior (clear bs->file / bs->backing pointers automatically when child->bs is cleared) in a nicer way. This reverts commit b0a9f6fed3d80de610dcd04a7e66f9f

[PATCH v2 08/11] iotests: drop some extra ** in qmp() call

2022-06-06 Thread Vladimir Sementsov-Ogievskiy
qmp() method supports passing dict (if it doesn't need substituting '_' to '-' in keys). So, drop some extra '**' operators. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/040| 4 +- tests/qemu-iotests/041

[PATCH v2 09/11] iotests.py: pause_job(): drop return value

2022-06-06 Thread Vladimir Sementsov-Ogievskiy
The returned value is unused. It's simple to check by command git grep -B 3 '\.pause_job(' Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tes

[PATCH v2 07/11] iotests: drop some occasional semicolons

2022-06-06 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/041 | 2 +- tests/qemu-iotests/196 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 index 4d7a829b65..550e4dc391 100755 --- a/tests/qemu-iotests/041 +++ b

[PATCH v2 05/11] iotests: add some missed checks of qmp result

2022-06-06 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/041| 1 + tests/qemu-iotests/151| 1 + tests/qemu-iotests/152| 2 ++ tests/qemu-iotests/tests/migrate-bitmaps-test | 2 ++ 4 files changed, 6 insertions

[PATCH v2 10/11] tests/vm/basevm.py: use cmd() instead of qmp()

2022-06-06 Thread Vladimir Sementsov-Ogievskiy
We don't expect failure here and need 'result' object. cmd() is better in this case. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/vm/basevm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 254e11c

[PATCH v2 04/11] iotests: QemuStorageDaemon: add cmd() method like in QEMUMachine.

2022-06-06 Thread Vladimir Sementsov-Ogievskiy
Add similar method for consistency. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 4 1 file changed, 4 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index c69b10ac82..dd08cd8a2b 100644 --- a/tests/qemu-iotests

[PATCH v2 02/11] python/qemu: rename command() to cmd()

2022-06-06 Thread Vladimir Sementsov-Ogievskiy
nd() in tests/docker/docker.py is unrelated). Signed-off-by: Vladimir Sementsov-Ogievskiy --- docs/devel/testing.rst| 10 +- python/qemu/machine/machine.py| 8 +- python/qemu/qmp/legacy.py | 2 +- python/qemu/qmp/qmp_shell.py

[PATCH v2 03/11] python/machine.py: upgrade vm.cmd() method

2022-06-06 Thread Vladimir Sementsov-Ogievskiy
The method is not popular in iotests, we prefer use vm.qmp() and then check success by hand.. But that's not optimal. To simplify movement to vm.cmd() let's support same interface improvements like in vm.qmp(). Signed-off-by: Vladimir Sementsov-Ogievskiy --- python/qemu/machine/machi

[PATCH v2 00/11] iotests: use vm.cmd()

2022-06-06 Thread Vladimir Sementsov-Ogievskiy
Hi all! Let's get rid of pattern result = self.vm.qmp(...) self.assert_qmp(result, 'return', {}) And switch to just self.vm.cmd(...) Supersedes: <20220408170214.45585-1-vsement...@openvz.org> ([RFC 0/2] introduce QEMUMachind.cmd()) Vladimir Sementsov-Ogi

[PATCH v2 06/11] iotests: refactor some common qmp result checks into generic pattern

2022-06-06 Thread Vladimir Sementsov-Ogievskiy
To simplify further conversion. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/040 | 3 ++- tests/qemu-iotests/147 | 3 ++- tests/qemu-iotests/155 | 4 ++-- tests/qemu-iotests/218 | 4 ++-- tests/qemu-iotests/296 | 3 ++- 5 files changed, 10 insertions(+), 7 deletions

[PATCH v2 01/11] python: rename QEMUMonitorProtocol.cmd() to cmd_raw()

2022-06-06 Thread Vladimir Sementsov-Ogievskiy
nd move to command() where possible. Signed-off-by: Vladimir Sementsov-Ogievskiy --- python/qemu/machine/machine.py | 2 +- python/qemu/qmp/legacy.py | 8 ++-- python/qemu/qmp/qmp_shell.py | 13 +++-- scripts/cpu-x86-uarch-abi.py | 12 ++-- tests/qemu-iotests/iotest

Re: [PATCH 1/1] block: use 'unsigned' for in_flight field on driver state

2022-06-02 Thread Vladimir Sementsov-Ogievskiy
hn Snow CC: Vladimir Sementsov-Ogievskiy CC: Kevin Wolf CC: Hanna Reitz CC: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v2 1/1] nbd: trace long NBD operations

2022-06-02 Thread Vladimir Sementsov-Ogievskiy
to add trace points for them. This patch is based on the original downstream work made by Vladimir. Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Vladimir Sementsov-Ogievskiy CC: Kevin Wolf CC: Hanna Reitz CC: Paolo Bonzini Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v3] block/gluster: correctly set max_pdiscard

2022-05-27 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Fabian Ebner Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v3 02/10] block: Change bdrv_{pread, pwrite, pwrite_sync}() param order

2022-05-27 Thread Vladimir Sementsov-Ogievskiy
@@ expression child, offset, buf, bytes, flags; @@ - bdrv_pwrite_sync(child, offset, buf, bytes, flags) + bdrv_pwrite_sync(child, offset, bytes, buf, flags) Resulting overly-long lines were then fixed by hand. Signed-off-by: Alberto Faria Reviewed-by: Paolo Bonzini Reviewed-by: Vladimir

Re: [PATCH v3 01/10] block: Add a 'flags' param to bdrv_{pread,pwrite,pwrite_sync}()

2022-05-27 Thread Vladimir Sementsov-Ogievskiy
) + bdrv_pwrite_sync(child, offset, buf, bytes, 0) Resulting overly-long lines were then fixed by hand. Signed-off-by: Alberto Faria Reviewed-by: Paolo Bonzini Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH 1/1] nbd: trace long NBD operations

2022-05-27 Thread Vladimir Sementsov-Ogievskiy
On 5/27/22 11:43, Denis V. Lunev wrote: +++ b/nbd/client-connection.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "trace.h" #include "block/nbd.h" @@ -210,6 +211,7 @@ static void *connect_thread_func(void *opaque) object_unref(OBJECT(conn->sioc));

Re: [PATCH 1/1] nbd: trace long NBD operations

2022-05-27 Thread Vladimir Sementsov-Ogievskiy
to add trace points for them. This patch is based on the original downstream work made by Vladimir. Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Vladimir Sementsov-Ogievskiy CC: Kevin Wolf CC: Hanna Reitz CC: Paolo Bonzini --- block/nbd.c | 11 --- block/trace

Re: [PATCH v4 0/7] copy-before-write: on-cbw-error and cbw-timeout

2022-05-26 Thread Vladimir Sementsov-Ogievskiy
On 5/26/22 19:46, Vladimir Sementsov-Ogievskiy wrote: On 4/7/22 16:27, Vladimir Sementsov-Ogievskiy wrote: Hi all! v4: Now based on master 01: add assertion and r-b 02: s/7.0/7.1/ and r-b 03: switch to QEMUMachine, touch-up pylintrc,  drop r-b 04,05,06: add r-b 07: switch to QEMUMachine Here

Re: [PATCH v4 0/7] copy-before-write: on-cbw-error and cbw-timeout

2022-05-26 Thread Vladimir Sementsov-Ogievskiy
On 4/7/22 16:27, Vladimir Sementsov-Ogievskiy wrote: Hi all! v4: Now based on master 01: add assertion and r-b 02: s/7.0/7.1/ and r-b 03: switch to QEMUMachine, touch-up pylintrc, drop r-b 04,05,06: add r-b 07: switch to QEMUMachine Here are two new options for copy-before-write filter: on

Re: [PATCH 1/2] python/machine.py: upgrade vm.command() method

2022-05-26 Thread Vladimir Sementsov-Ogievskiy
On 4/8/22 20:02, Vladimir Sementsov-Ogievskiy wrote: The method is not popular, we prefer use vm.qmp() and then check Suddenly I found, that I missed a lot of existing users: in scripts, in avocado tests. Do you prefer to rename the method to "cmd()", and change all the occurrence

[PATCH] MAINTAINERS: update Vladimir's address and repositories

2022-05-26 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- Hi all! Finally, I'm at Yandex, so that's my new address. I don't think .mailmap or contrib/gitdm/aliases really need to be updated. I send this patch now, but let me send one-two series from new address before merging this,

Re: [PATCH] aio_wait_kick: add missing memory barrier

2022-05-24 Thread Vladimir Sementsov-Ogievskiy
Read aio_wait_kick() comment for further explanation. Suggested-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito Thanks! Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: aio_wait_bh_oneshot() thread-safety question

2022-05-24 Thread Vladimir Sementsov-Ogievskiy
On 5/24/22 15:40, Kevin Wolf wrote: Am 24.05.2022 um 09:08 hat Paolo Bonzini geschrieben: On 5/23/22 18:04, Vladimir Sementsov-Ogievskiy wrote: I have a doubt about how aio_wait_bh_oneshot() works. Exactly, I see that data->done is not accessed atomically, and doesn't have any

aio_wait_bh_oneshot() thread-safety question

2022-05-23 Thread Vladimir Sementsov-Ogievskiy
Hi all (yes, that's my new address, I hope for a long time. ) I have a doubt about how aio_wait_bh_oneshot() works. Exactly, I see that data->done is not accessed atomically, and doesn't have any barrier protecting it.. Is following possible: main-loop iothread

Re: [RFC 0/2] introduce QEMUMachind.cmd()

2022-05-17 Thread Vladimir Sementsov-Ogievskiy
27.04.2022 22:29, John Snow wrote: On Fri, Apr 8, 2022 at 1:02 PM Vladimir Sementsov-Ogievskiy wrote: Hi all! I always dreamed about getting rid of pattern result = self.vm.qmp(...) self.assert_qmp(result, 'return', {}) Here is a suggestion to switch to s

[PATCH v4 3/3] block: simplify handling of try to merge different sized bitmaps

2022-05-17 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy We have too much logic to simply check that bitmaps are of the same size. Let's just define that hbitmap_merge() and bdrv_dirty_bitmap_merge_internal() require their argument bitmaps be of same size, this simplifies things. Let's look through the cal

[PATCH v4 1/3] block: block_dirty_bitmap_merge(): fix error path

2022-05-17 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy At the end we ignore failure of bdrv_merge_dirty_bitmap() and report success. And still set errp. That's wrong. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Nikita Lapshin Reviewed-by: Kevin Wolf --- block/monitor/bitmap-qmp-cmds.c | 5 +++

[PATCH v4 2/3] block: improve block_dirty_bitmap_merge(): don't allocate extra bitmap

2022-05-17 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy We don't need extra bitmap. All we need is to backup the original bitmap when we do first merge. So, drop extra temporary bitmap and work directly with target and backup. Still to keep old semantics, that on failure target is unchanged and user don'

[PATCH v4 0/3] block/dirty-bitmaps: fix and improve bitmap merge

2022-05-17 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy v4: 01,03: add Kevin's r-b 02: add hbitmap_free() on success patch if local_backup is not needed Vladimir Sementsov-Ogievskiy (3): block: block_dirty_bitmap_merge(): fix error path block: improve block_dirty_bitmap_merge(): don't allocate ex

Re: [PATCH v3 2/3] block: improve block_dirty_bitmap_merge(): don't allocate extra bitmap

2022-05-17 Thread Vladimir Sementsov-Ogievskiy
03.05.2022 12:24, Kevin Wolf wrote: Am 01.04.2022 um 12:08 hat Vladimir Sementsov-Ogievskiy geschrieben: We don't need extra bitmap. All we need is to backup the original bitmap when we do first merge. So, drop extra temporary bitmap and work directly with target and backup. Still to kee

Re: [PATCH v2 09/10] block: Use bdrv_co_pwrite_sync() when caller is coroutine_fn

2022-05-17 Thread Vladimir Sementsov-Ogievskiy
13.05.2022 18:57, Alberto Faria wrote: Convert uses of bdrv_pwrite_sync() into bdrv_co_pwrite_sync() when the callers are already coroutine_fn. Signed-off-by: Alberto Faria Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH] nbd: Drop dead code spotted by Coverity

2022-05-17 Thread Vladimir Sementsov-Ogievskiy
(rc >= 0 && qio_channel_writev_all(s->ioc, qiov->iov, qiov->niov, + NULL) < 0) { rc = -EIO; } qio_channel_set_cork(s->ioc, false); Hi all! I am back). And happy to start with something

Re: [PATCH v2 for 7.1 1/1] block: add 'force' parameter to 'blockdev-change-medium' command

2022-04-12 Thread Vladimir Sementsov-Ogievskiy
lan Gilbert" CC: Eric Blake CC: Markus Armbruster CC: Vladimir Sementsov-Ogievskiy --- block/qapi-sysemu.c | 3 ++- hmp-commands.hx | 11 +++ monitor/hmp-cmds.c | 4 +++- qapi/block.json | 6 ++ ui/cocoa.m | 1 + 5 files changed, 19 insertions(+), 6

Re: [PATCH v2 2/3] qapi: nbd-export: allow select bitmaps by node/name pair

2022-04-08 Thread Vladimir Sementsov-Ogievskiy
17.03.2022 00:28, Eric Blake wrote: +++ b/qapi/block-export.json @@ -6,6 +6,7 @@ ## { 'include': 'sockets.json' } +{ 'include': 'block-core.json' } Hmm. Does this extra inclusion negatively impact qemu-storage-daemon, since that is why we created block-export.json in the first place (to

[RFC 0/2] introduce QEMUMachind.cmd()

2022-04-08 Thread Vladimir Sementsov-Ogievskiy
01, and use new interface for new code. On the other hand, old code always used as an example to write the new one. The series is based on John's python branch. Vladimir Sementsov-Ogievskiy (2): python/machine.py: upgrade vm.command() method iotests: use vm.cmd() instead of vm.qmp() where

[PATCH 1/2] python/machine.py: upgrade vm.command() method

2022-04-08 Thread Vladimir Sementsov-Ogievskiy
The method is not popular, we prefer use vm.qmp() and then check success by hand.. But that's not optimal. To simplify movement to vm.command() support same interface improvements like in vm.qmp() and rename to shorter vm.cmd(). Signed-off-by: Vladimir Sementsov-Ogievskiy --- python

Re: [PATCH 1/2] spec: Recommend cap on NBD_REPLY_TYPE_BLOCK_STATUS length

2022-04-07 Thread Vladimir Sementsov-Ogievskiy
ogress on a successful return. The server SHOULD +use different *status* values between consecutive descriptors where feasible, although the client SHOULD be prepared to handle consecutive descriptors with the same *status* value. The server SHOULD use descriptor Review

Re: [PATCH v3] spec: Clarify BLOCK_STATUS reply details

2022-04-07 Thread Vladimir Sementsov-Ogievskiy
08.04.2022 00:34, Eric Blake wrote: On Thu, Apr 07, 2022 at 11:37:31PM +0300, Vladimir Sementsov-Ogievskiy wrote: 02.04.2022 00:08, Eric Blake wrote: Our docs were inconsistent on whether a NBD_REPLY_TYPE_BLOCK_STATUS reply chunk can exceed the client's requested length, and silent on wh

Re: [PATCH for 7.1 1/1] block: add 'force' parameter to 'blockdev-change-medium' command

2022-04-07 Thread Vladimir Sementsov-Ogievskiy
07.04.2022 23:48, Denis V. Lunev wrote: 'blockdev-change-medium' is a convinient wrapper for the following sequence of commands: * blockdev-open-tray * blockdev-remove-medium * blockdev-insert-medium * blockdev-close-tray and should be used f.e. to change ISO image inside the CD-ROM tray.

Re: [PATCH v3] spec: Clarify BLOCK_STATUS reply details

2022-04-07 Thread Vladimir Sementsov-Ogievskiy
than original request length (accordingly to old spec):) Reviewed-by: Vladimir Sementsov-Ogievskiy Clean up some nearby grammatical errors while at it. --- Another round of rewording attempts, based on feedback from Rich on v2. I went ahead and pushed patch 1 and 2 of the v2 series, as they

[PATCH v4 7/7] iotests: copy-before-write: add cases for cbw-timeout option

2022-04-07 Thread Vladimir Sementsov-Ogievskiy
Add two simple test-cases: timeout failure with break-snapshot-on-cbw-error behavior and similar with break-guest-write-on-cbw-error behavior. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/tests/copy-before-write| 81 +++ .../qemu-iotests/tests/copy

[PATCH v4 5/7] block/block-copy: block_copy(): add timeout_ns parameter

2022-04-07 Thread Vladimir Sementsov-Ogievskiy
s on block-copy call finish. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- include/block/block-copy.h | 4 +++- block/block-copy.c | 33 ++--- block/copy-before-write.c | 2 +- 3 files changed, 30 insertions(+), 9 deletions(-) di

[PATCH v4 4/7] util: add qemu-co-timeout

2022-04-07 Thread Vladimir Sementsov-Ogievskiy
Add new API, to make a time limited call of the coroutine. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- include/qemu/coroutine.h | 13 ++ util/qemu-co-timeout.c | 89 util/meson.build | 1 + 3 files changed

[PATCH v4 2/7] block/copy-before-write: add on-cbw-error open parameter

2022-04-07 Thread Vladimir Sementsov-Ogievskiy
n BREAK_SNAPSHOT-failure path in cbw_do_copy_before_write(). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- qapi/block-core.json | 25 - block/copy-before-write.c | 32 ++-- 2 files changed, 54 insertions(+), 3 de

[PATCH v4 6/7] block/copy-before-write: implement cbw-timeout option

2022-04-07 Thread Vladimir Sementsov-Ogievskiy
ree the state in .bdrv_close() earlier. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- qapi/block-core.json | 8 +++- block/copy-before-write.c | 23 ++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/qapi/block-core.json

[PATCH v4 1/7] block/copy-before-write: refactor option parsing

2022-04-07 Thread Vladimir Sementsov-Ogievskiy
We are going to add one more option of enum type. Let's refactor option parsing so that we can simply work with BlockdevOptionsCbw object. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- block/copy-before-write.c | 56 --- 1

[PATCH v4 3/7] iotests: add copy-before-write: on-cbw-error tests

2022-04-07 Thread Vladimir Sementsov-Ogievskiy
: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/pylintrc | 5 + tests/qemu-iotests/tests/copy-before-write| 132 ++ .../qemu-iotests/tests/copy-before-write.out | 5 + 3 files changed, 142 insertions(+) create mode 100755 tests/qemu-iotests/tests/c

[PATCH v4 0/7] copy-before-write: on-cbw-error and cbw-timeout

2022-04-07 Thread Vladimir Sementsov-Ogievskiy
seconds and will never fail due to backup problems. Vladimir Sementsov-Ogievskiy (7): block/copy-before-write: refactor option parsing block/copy-before-write: add on-cbw-error open parameter iotests: add copy-before-write: on-cbw-error tests util: add qemu-co-timeout block/block-copy

Re: [PATCH v3 7/7] iotests: copy-before-write: add cases for cbw-timeout option

2022-04-07 Thread Vladimir Sementsov-Ogievskiy
07.04.2022 12:19, Hanna Reitz wrote: On 06.04.22 20:08, Vladimir Sementsov-Ogievskiy wrote: Add two simple test-cases: timeout failure with break-snapshot-on-cbw-error behavior and similar with break-guest-write-on-cbw-error behavior. Signed-off-by: Vladimir Sementsov-Ogievskiy ---   tests

Re: [PATCH 1/2] block/throttle-groups: use QEMU_CLOCK_REALTIME for qtest too

2022-04-07 Thread Vladimir Sementsov-Ogievskiy
Thanks for explanation! 07.04.2022 09:42, Hanna Reitz wrote: On 06.04.22 17:32, Vladimir Sementsov-Ogievskiy wrote: Virtual clock just doesn't tick for iotests, and throttling just not work. Let's use realtime clock. It does tick when you make it take, specifically with the clock_

[PATCH v3 7/7] iotests: copy-before-write: add cases for cbw-timeout option

2022-04-06 Thread Vladimir Sementsov-Ogievskiy
Add two simple test-cases: timeout failure with break-snapshot-on-cbw-error behavior and similar with break-guest-write-on-cbw-error behavior. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/tests/copy-before-write| 78 +++ .../qemu-iotests/tests/copy

[PATCH v3 5/7] block/block-copy: block_copy(): add timeout_ns parameter

2022-04-06 Thread Vladimir Sementsov-Ogievskiy
s on block-copy call finish. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block-copy.h | 4 +++- block/block-copy.c | 33 ++--- block/copy-before-write.c | 2 +- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/include/block/bl

[PATCH v3 1/7] block/copy-before-write: refactor option parsing

2022-04-06 Thread Vladimir Sementsov-Ogievskiy
We are going to add one more option of enum type. Let's refactor option parsing so that we can simply work with BlockdevOptionsCbw object. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/copy-before-write.c | 55 --- 1 file changed, 28 insertions(+

[PATCH v3 3/7] iotests: add copy-before-write: on-cbw-error tests

2022-04-06 Thread Vladimir Sementsov-Ogievskiy
Add tests for new option of copy-before-write filter: on-cbw-error. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- tests/qemu-iotests/tests/copy-before-write| 128 ++ .../qemu-iotests/tests/copy-before-write.out | 5 + 2 files changed, 133

[PATCH v3 4/7] util: add qemu-co-timeout

2022-04-06 Thread Vladimir Sementsov-Ogievskiy
Add new API, to make a time limited call of the coroutine. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/qemu/coroutine.h | 13 ++ util/qemu-co-timeout.c | 89 util/meson.build | 1 + 3 files changed, 103 insertions(+) create

<    4   5   6   7   8   9   10   11   12   13   >