[PATCH v7 1/5] blockdev: refactor transaction to use Transaction API

2023-02-21 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy We are going to add more block-graph modifying transaction actions, and block-graph modifying functions are already based on Transaction API. Next, we'll need to separately update permissions after several graph-modifying actions, and this would be simple

[PATCH v7 2/5] blockdev: transactions: rename some things

2023-02-21 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy Look at qmp_transaction(): dev_list is not obvious name for list of actions. Let's look at qapi spec, this argument is "actions". Let's follow the common practice of using same argument names in qapi scheme and code. To be honest, rename props to

[PATCH v7 0/5] block: refactor blockdev transactions

2023-02-21 Thread Vladimir Sementsov-Ogievskiy
Hi all! v7: fixed my email, sorry for the noise. That's a next portion of old good "[PATCH v5 00/45] Transactional block-graph modifying API", rebased to master. Now, refactor QMP transactions implementation into new (relatively) transaction API. Vladimir Sementsov-Ogievskiy (5):

[PATCH v7 3/5] blockdev: qmp_transaction: refactor loop to classic for

2023-02-21 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy --- blockdev.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/blockdev.c b/blockdev.c index 2174ab2694..89c573a094 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2375,7 +2375,7 @@ void

[PATCH v6 2/5] blockdev: transactions: rename some things

2023-02-21 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy Look at qmp_transaction(): dev_list is not obvious name for list of actions. Let's look at qapi spec, this argument is "actions". Let's follow the common practice of using same argument names in qapi scheme and code. To be honest, rename props to

[PATCH v6 3/5] blockdev: qmp_transaction: refactor loop to classic for

2023-02-21 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy --- blockdev.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/blockdev.c b/blockdev.c index 2174ab2694..89c573a094 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2375,7 +2375,7 @@ void

[PATCH v6 1/5] blockdev: refactor transaction to use Transaction API

2023-02-21 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy We are going to add more block-graph modifying transaction actions, and block-graph modifying functions are already based on Transaction API. Next, we'll need to separately update permissions after several graph-modifying actions, and this would be simple

[PATCH v6 5/5] blockdev: qmp_transaction: drop extra generic layer

2023-02-21 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy Let's simplify things: First, actions generally don't need access to common BlkActionState structure. The only exclusion are backup actions that need block_job_txn. Next, for transaction actions of Transaction API is more native to allocated state structure

[PATCH v6 4/5] blockdev: transaction: refactor handling transaction properties

2023-02-21 Thread Vladimir Sementsov-Ogievskiy
From: Vladimir Sementsov-Ogievskiy Only backup supports GROUPED mode. Make this logic more clear. And avoid passing extra thing to each action. Signed-off-by: Vladimir Sementsov-Ogievskiy --- blockdev.c | 92 +++--- 1 file changed, 19 insertions

[PATCH v6 0/5] block: refactor blockdev transactions

2023-02-21 Thread Vladimir Sementsov-Ogievskiy
Hi all! That's a next portion of old good "[PATCH v5 00/45] Transactional block-graph modifying API", rebased to master. Now, refactor QMP transactions implementation into new (relatively) transaction API. Vladimir Sementsov-Ogievskiy (5): blockdev: refactor transaction to use Trans

Re: online blockdev-backup, a clarification (was: Summary on new backup interfaces in QEMU)

2023-02-20 Thread Vladimir Sementsov-Ogievskiy
On 20.02.23 18:18, John Maline wrote: As a qemu newcomer I had a related question and confusion from reading existing docs. Searching qemu-block, this seemed related to my question so I’ll ask… On Mar 15, 2022, at 12:57 PM, Vladimir Sementsov-Ogievskiy wrote: Hi all! Here I want

Re: [PATCH 0/4] qemu-img: Fix exit code for errors closing the image

2023-02-15 Thread Vladimir Sementsov-Ogievskiy
On 15.02.23 16:07, Markus Armbruster wrote: Kevin Wolf writes: Am 13.01.2023 um 08:30 hat Markus Armbruster geschrieben: Drive-by comment... Kevin Wolf writes: This series addresses the problem described in these bug reports: https://gitlab.com/qemu-project/qemu/-/issues/1330

Re: [PATCH v2 3/3] migration: Rename res_{postcopy,precopy}_only

2023-02-15 Thread Vladimir Sementsov-Ogievskiy
(trace_vfio_state_pending, trace_migrate_pending_estimate, trace_migrate_pending_exact) should be changed correspondingly. with or without: Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v2 1/3] migration: In case of postcopy, the memory ends in res_postcopy_only

2023-02-15 Thread Vladimir Sementsov-Ogievskiy
On 15.02.23 20:03, Juan Quintela wrote: So remove last assignation of res_compatible. Signed-off-by: Juan Quintela Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

[PATCH v5 14/16] iotests.py: pause_job(): drop return value

2023-02-15 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/tests/qemu-iotests

[PATCH v5 10/16] iotests: add some missed checks of qmp result

2023-02-15 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 v5 08/16] python/machine.py: upgrade vm.cmd() method

2023-02-15 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/machine.py | 12

[PATCH v5 12/16] iotests: drop some occasional semicolons

2023-02-15 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 v5 05/16] scripts/cpu-x86-uarch-abi.py: use .command() instead of .cmd()

2023-02-15 Thread Vladimir Sementsov-Ogievskiy
Here we don't expect a failure. In case on failure we'll crash on trying to access ['return']. Let's better use .command() that clearly raise on failure. Signed-off-by: Vladimir Sementsov-Ogievskiy --- scripts/cpu-x86-uarch-abi.py | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions

[PATCH v5 09/16] iotests: QemuStorageDaemon: add cmd() method like in QEMUMachine.

2023-02-15 Thread Vladimir Sementsov-Ogievskiy
Add similar method for consistency. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 675fbaa1c3..8ef1c8a5d2 100644

[PATCH v5 06/16] python: rename QEMUMonitorProtocol.cmd() to cmd_raw()

2023-02-15 Thread Vladimir Sementsov-Ogievskiy
Having cmd() and command() methods in one class doesn't look good. Rename cmd() to cmd_raw(), to show its meaning better. We also want to rename command() to cmd() in future, so this commit is a necessary step. Signed-off-by: Vladimir Sementsov-Ogievskiy --- python/qemu/machine/machine.py | 2

[PATCH v5 04/16] qmp_shell.py: _fill_completion() use .command() instead of .cmd()

2023-02-15 Thread Vladimir Sementsov-Ogievskiy
We just want to ignore failure, so we don't need low level .cmd(). This helps further renaming .command() to .cmd(). Signed-off-by: Vladimir Sementsov-Ogievskiy --- python/qemu/qmp/qmp_shell.py | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/python/qemu

[PATCH v5 15/16] tests/vm/basevm.py: use cmd() instead of qmp()

2023-02-15 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 23229e23d1..e61f9f0fd1

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

2023-02-15 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 v5 03/16] python/qemu/qmp/legacy: cmd(): drop cmd_id unused argument

2023-02-15 Thread Vladimir Sementsov-Ogievskiy
The argument is unused, let's drop it for now, as we are going to refactor the interface and don't want to refactor unused things. Signed-off-by: Vladimir Sementsov-Ogievskiy --- python/qemu/qmp/legacy.py | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/python/qemu/qmp

[PATCH v5 13/16] iotests: drop some extra ** in qmp() call

2023-02-15 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| 14 +++--- tests

[PATCH v5 07/16] python/qemu: rename command() to cmd()

2023-02-15 Thread Vladimir Sementsov-Ogievskiy
is unrelated). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Daniel P. Berrangé --- docs/devel/testing.rst| 10 +- python/qemu/machine/machine.py| 8 +- python/qemu/qmp/legacy.py | 2 +- python/qemu/qmp/qmp_shell.py

[PATCH v5 01/16] python: fix superfluous-parens pylint error

2023-02-15 Thread Vladimir Sementsov-Ogievskiy
Now make check-dev called in python/ directory fails due to this error. Let's fix it. Signed-off-by: Vladimir Sementsov-Ogievskiy --- python/qemu/qmp/protocol.py| 2 +- python/qemu/qmp/qmp_client.py | 2 +- tests/qemu-iotests/tests/migrate

[PATCH v5 02/16] python: fix broad-exception-raised pylint error

2023-02-15 Thread Vladimir Sementsov-Ogievskiy
Now 'make check-dev' called in python/ directory raises several W0719: Raising too general exception: Exception (broad-exception-raised) Let's fix. Signed-off-by: Vladimir Sementsov-Ogievskiy --- python/qemu/utils/qemu_ga_client.py | 6 +++--- tests/qemu-iotests/iotests.py | 4 ++-- 2

[PATCH v5 00/16] iotests: use vm.cmd()

2023-02-15 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(...) v5: - include fixups by John - fix 'make check-dev' - split first patch into several [Daniel] Vladimir Sementsov-Ogievskiy (16): python: fix

Re: [PATCH v10 01/12] parallels: Out of image offset in BAT leads to image inflation

2023-02-15 Thread Vladimir Sementsov-Ogievskiy
On 15.02.23 14:29, Denis V. Lunev wrote: On 2/14/23 18:44, Vladimir Sementsov-Ogievskiy wrote: On 03.02.23 12:18, Alexander Ivanov wrote: data_end field in BDRVParallelsState is set to the biggest offset present in BAT. If this offset is outside of the image, any further write will create

Re: [PATCH 1/3] migration: In case of postcopy, the memory ends in res_postcopy_only

2023-02-15 Thread Vladimir Sementsov-Ogievskiy
On 15.02.23 12:08, Juan Quintela wrote: Vladimir Sementsov-Ogievskiy wrote: On 08.02.23 16:57, Juan Quintela wrote: So remove last assignation of res_compatible. I hoped for some description when asked to split it out :) Signed-off-by: Juan Quintela --- migration/ram.c | 2 +- 1

Re: [PATCH 0/4] qemu-img: Fix exit code for errors closing the image

2023-02-14 Thread Vladimir Sementsov-Ogievskiy
On 13.01.23 14:29, Kevin Wolf wrote: Another thing that could be tried is making failure in .bdrv_close less likely by doing things earlier. At least ENOSPC could probably be avoided if dirty bitmaps clusters were allocated during the write request that first sets a bit in them (I know too

Re: [PATCH 3/3] migration: Remove _only suffix for res_postcopy/precopy

2023-02-14 Thread Vladimir Sementsov-Ogievskiy
On 14.02.23 21:22, Juan Quintela wrote: Vladimir Sementsov-Ogievskiy wrote: On 08.02.23 16:57, Juan Quintela wrote: Once that res_compatible is removed, they don't make sense anymore. Signed-off-by: Juan Quintela --- include/migration/register.h | 18 -- migration

[PATCH] MAINTAINERS: drop Vladimir from parallels block driver

2023-02-14 Thread Vladimir Sementsov-Ogievskiy
I have to admit this is out of my scope now. Still feel free to Cc me directly if my help is needed :) Signed-off-by: Vladimir Sementsov-Ogievskiy --- MAINTAINERS | 2 -- 1 file changed, 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 96e25f62ac..12bc96f52a 100644 --- a/MAINTAINERS

Re: [PATCH v10 02/12] parallels: Fix high_off calculation in parallels_co_check()

2023-02-14 Thread Vladimir Sementsov-Ogievskiy
On 03.02.23 12:18, Alexander Ivanov wrote: Don't let high_off be more than the file size even if we don't fix the image. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v10 01/12] parallels: Out of image offset in BAT leads to image inflation

2023-02-14 Thread Vladimir Sementsov-Ogievskiy
On 03.02.23 12:18, Alexander Ivanov wrote: data_end field in BDRVParallelsState is set to the biggest offset present in BAT. If this offset is outside of the image, any further write will create the cluster at this offset and/or the image will be truncated to this offset on close. This is

Re: [PATCH] hbitmap: fix hbitmap_status() return value for first dirty bit case

2023-02-14 Thread Vladimir Sementsov-Ogievskiy
tatus()") Ohh :/ Signed-off-by: Andrey Zhadchenko Reviewed-by: Vladimir Sementsov-Ogievskiy --- include/qemu/hbitmap.h | 2 +- util/hbitmap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qemu/hbitmap.h b/include/qemu/hbitmap.h index

Re: [PATCH] block/mirror: add 'write-blocking-after-ready' copy mode

2023-02-14 Thread Vladimir Sementsov-Ogievskiy
On 14.02.23 17:29, Fiona Ebner wrote: [..] [0]: Is there a good way to peek the iterator without doing something like the following (we do know the offset from last time in mirror_iteration(), so that is not an issue)? offset_from_last_time = bdrv_dirty_iter_next(s->dbi); ...other stuff...

Re: [PATCH] block/mirror: add 'write-blocking-after-ready' copy mode

2023-02-14 Thread Vladimir Sementsov-Ogievskiy
On 02.02.23 16:27, Fiona Ebner wrote: Am 02.02.23 um 12:34 schrieb Kevin Wolf: Am 02.02.2023 um 11:19 hat Fiona Ebner geschrieben: Am 31.01.23 um 19:18 schrieb Denis V. Lunev: Frankly speaking I would say that this switch could be considered NOT QEMU job and we should just send a notification

Re: [PATCH] block/mirror: add 'write-blocking-after-ready' copy mode

2023-02-14 Thread Vladimir Sementsov-Ogievskiy
On 02.02.23 18:23, Kevin Wolf wrote: Am 02.02.2023 um 14:35 hat Denis V. Lunev geschrieben: On 2/2/23 14:27, Fiona Ebner wrote: Am 02.02.23 um 12:34 schrieb Kevin Wolf: Am 02.02.2023 um 11:19 hat Fiona Ebner geschrieben: Am 31.01.23 um 19:18 schrieb Denis V. Lunev: Frankly speaking I would

Re: [PATCH 3/3] migration: Remove _only suffix for res_postcopy/precopy

2023-02-14 Thread Vladimir Sementsov-Ogievskiy
On 08.02.23 16:57, Juan Quintela wrote: Once that res_compatible is removed, they don't make sense anymore. Signed-off-by: Juan Quintela --- include/migration/register.h | 18 -- migration/savevm.h | 8 hw/s390x/s390-stattrib.c | 7 +++

Re: [PATCH 2/3] migration: Remove unused res_compatible

2023-02-14 Thread Vladimir Sementsov-Ogievskiy
ize = pend_pre + pend_compat + pend_post; +qemu_savevm_state_pending_estimate(_pre, _post); +uint64_t pending_size = pend_pre + pend_post; Mixed declarations are "gnerally not allowed" by devel/style.rst.. Preexisting, but we may fix it now. Anyway: Reviewed-by: Vladimir Sement

Re: [PATCH 1/3] migration: In case of postcopy, the memory ends in res_postcopy_only

2023-02-14 Thread Vladimir Sementsov-Ogievskiy
On 09.02.23 21:10, Juan Quintela wrote: Vladimir Sementsov-Ogievskiy wrote: On 08.02.23 16:57, Juan Quintela wrote: So remove last assignation of res_compatible. I hoped for some description when asked to split it out :) Signed-off-by: Juan Quintela --- migration/ram.c | 2 +- 1

Re: [PATCH 1/1] block: improve error logging in bdrv_reopen_prepare()

2023-02-13 Thread Vladimir Sementsov-Ogievskiy
above. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Hanna Reitz CC: Vladimir Sementsov-Ogievskiy Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH 1/3] migration: In case of postcopy, the memory ends in res_postcopy_only

2023-02-09 Thread Vladimir Sementsov-Ogievskiy
On 08.02.23 16:57, Juan Quintela wrote: So remove last assignation of res_compatible. I hoped for some description when asked to split it out :) Signed-off-by: Juan Quintela --- migration/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/ram.c

Re: [PATCH] block/mirror: add 'write-blocking-after-ready' copy mode

2023-01-31 Thread Vladimir Sementsov-Ogievskiy
+ Den Den, I remember we thought about that, and probably had a solution? Another possible approach to get benefits from both modes is to switch to blocking mode after first loop of copying. [*] Hmm. Thinking about proposed solution it seems, that [*] is better. The main reason of

Re: [PULL 5/5] migration: simplify migration_iteration_run()

2023-01-31 Thread Vladimir Sementsov-Ogievskiy
On 30.01.23 11:03, Juan Quintela wrote: Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert --- migration/migration.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index

Re: [PATCH v3] migration: Remove res_compatible parameter

2023-01-31 Thread Vladimir Sementsov-Ogievskiy
On 1/30/23 11:06, Juan Quintela wrote: It was only used for RAM, and in that case, it means that this amount of data was sent for memory. Just delete the field in all callers. Could you describe, why it's safe to change the behavior for RAM? Also, I think it would be a lot better to split

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

2023-01-10 Thread Vladimir Sementsov-Ogievskiy
On 1/10/23 13:49, Daniel P. Berrangé wrote: On Tue, Jan 10, 2023 at 11:37:48AM +0300, Vladimir Sementsov-Ogievskiy wrote: Having cmd() and command() methods in one class doesn't look good. Rename cmd() to cmd_raw(), to show its meaning better. We also want to rename command() to cmd

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

2023-01-10 Thread Vladimir Sementsov-Ogievskiy
On 7/12/22 00:21, John Snow wrote: On Mon, Jul 11, 2022 at 5:16 PM John Snow wrote: On Fri, Jun 24, 2022 at 3:53 PM Vladimir Sementsov-Ogievskiy wrote: I've spent much time trying to debug hanging pipeline in gitlab. I started from and idea that I have problem in code in my series (which

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

2023-01-10 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| 14 +++--- tests

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

2023-01-10 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 2276364c42..ff7e4fea15

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

2023-01-10 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 v4 03/11] python/machine.py: upgrade vm.cmd() method

2023-01-10 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/machine.py | 12

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

2023-01-10 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 v3 08/11] iotests: drop some extra ** in qmp() call

2023-01-10 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| 14 +++--- tests

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

2023-01-10 Thread Vladimir Sementsov-Ogievskiy
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/iotests.py | 2

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

2023-01-10 Thread Vladimir Sementsov-Ogievskiy
Oops, no qemu-devel in CC. Sorry. Will resend -- Best regards, Vladimir

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

2023-01-10 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 v4 01/11] python: rename QEMUMonitorProtocol.cmd() to cmd_raw()

2023-01-10 Thread Vladimir Sementsov-Ogievskiy
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/iotests.py | 2

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

2023-01-10 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 v3 00/11] iotests: use vm.cmd()

2023-01-10 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(...) v3: rebase on master, fix some over-80 lines Vladimir Sementsov-Ogievskiy (11): python: rename QEMUMonitorProtocol.cmd() to cmd_raw() python

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

2023-01-10 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/tests/qemu-iotests

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

2023-01-10 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 2276364c42..ff7e4fea15

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

2023-01-10 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(...) v4: resend to fix CC v3: rebase on master, fix some over-80 lines Vladimir Sementsov-Ogievskiy (11): python: rename QEMUMonitorProtocol.cmd

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

2023-01-10 Thread Vladimir Sementsov-Ogievskiy
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 | 2 +- python/qemu/utils

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

2023-01-10 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 v3 09/11] iotests.py: pause_job(): drop return value

2023-01-10 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/tests/qemu-iotests

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

2023-01-10 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 v3 06/11] iotests: refactor some common qmp result checks into generic pattern

2023-01-10 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 v3 02/11] python/qemu: rename command() to cmd()

2023-01-10 Thread Vladimir Sementsov-Ogievskiy
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 | 2 +- python/qemu/utils

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

2023-01-10 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 v3 03/11] python/machine.py: upgrade vm.cmd() method

2023-01-10 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/machine.py | 12

Re: [PATCH v2 3/6] spec: Add NBD_OPT_EXTENDED_HEADERS

2022-12-19 Thread Vladimir Sementsov-Ogievskiy
On 11/15/22 01:46, Eric Blake wrote: Add a new negotiation feature where the client and server agree to use larger packet headers on every packet sent during transmission phase. This has two purposes: first, it makes it possible to perform operations like trim, write zeroes, and block status on

Re: [PATCH v2 2/6] spec: Tweak description of maximum block size

2022-12-16 Thread Vladimir Sementsov-Ogievskiy
On 11/15/22 01:46, Eric Blake wrote: Commit 9f30fedb improved the spec to allow non-payload requests that exceed any advertised maximum block size. Take this one step further by permitting the server to use NBD_EOVERFLOW as a hint to the client when a request is oversize (while permitting

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

2022-12-16 Thread Vladimir Sementsov-Ogievskiy
addition of 64-bit requests, where a client's request is no longer bounded to 4G and could thereby produce even more than 8M extents for the corner case when every 512 bytes is a new extent, if it were not for this recommendation. s-o-b line missed. Reviewed-by: Vladimir Sementsov-Ogievskiy

Re: [PATCH 14/14] block: Rename newly converted BlockDriver IO coroutine functions

2022-12-16 Thread Vladimir Sementsov-Ogievskiy
On 12/13/22 11:53, Kevin Wolf wrote: diff --git a/block/blkdebug.c b/block/blkdebug.c index 4265ca125e..d8e199d59c 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -1076,7 +1076,7 @@ static BlockDriver bdrv_blkdebug = { .bdrv_reopen_prepare= blkdebug_reopen_prepare,

Re: [PATCH 07/14] block: use bdrv_co_refresh_total_sectors when possible

2022-12-16 Thread Vladimir Sementsov-Ogievskiy
On 12/13/22 11:53, Kevin Wolf wrote: From: Emanuele Giuseppe Esposito In some places we are sure we are always running in a coroutine, therefore it's useless to call the generated_co_wrapper, instead call directly the _co_ function. Signed-off-by: Emanuele Giuseppe Esposito Signed-off-by:

Re: [PATCH 06/14] block-backend: use bdrv_getlength instead of blk_getlength

2022-12-16 Thread Vladimir Sementsov-Ogievskiy
and the reasoning, but the change looks like a degradation.. bdrv_* functions becomes kind of *_locked() ? If we are going to introduce a lot of such changes, that's not good. But this one is not a problem of course. Reviewed-by: Vladimir Sementsov-Ogievskiy if (len

Re: [PATCH 05/14] block: Convert bdrv_refresh_total_sectors() to co_wrapper_mixed

2022-12-16 Thread Vladimir Sementsov-Ogievskiy
On 12/13/22 11:53, Kevin Wolf wrote: --- a/include/block/block_int-common.h +++ b/include/block/block_int-common.h @@ -684,7 +684,7 @@ struct BlockDriver { int coroutine_fn (*bdrv_co_truncate)(BlockDriverState *bs, int64_t offset, bool exact,

Re: [PATCH 04/14] block: Rename refresh_total_sectors to bdrv_refresh_total_sectors

2022-12-16 Thread Vladimir Sementsov-Ogievskiy
Esposito Signed-off-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH 02/14] block: Convert bdrv_io_plug() to co_wrapper

2022-12-16 Thread Vladimir Sementsov-Ogievskiy
On 12/13/22 11:53, Kevin Wolf wrote: --- a/include/block/block_int-common.h +++ b/include/block/block_int-common.h @@ -729,7 +729,7 @@ struct BlockDriver { void (*bdrv_debug_event)(BlockDriverState *bs, BlkdebugEvent event); /* io queue for linux-aio */ -void

Re: [PATCH 02/14] block: Convert bdrv_io_plug() to co_wrapper

2022-12-16 Thread Vladimir Sementsov-Ogievskiy
lug)(BlockDriverState *bs); don't we want to rename it to _co_ too? anyway: Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH 01/14] block-coroutine-wrapper: support void functions

2022-12-16 Thread Vladimir Sementsov-Ogievskiy
On 12/13/22 11:53, Kevin Wolf wrote: From: Emanuele Giuseppe Esposito Just omit the various 'return' when the return type is void. Signed-off-by: Emanuele Giuseppe Esposito Signed-off-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH-for-8.0] block/nbd: Add missing include

2022-11-25 Thread Vladimir Sementsov-Ogievskiy
) /* Defines nbd_read16(). */ | ^~ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v6 14/14] block/dirty-bitmap: convert coroutine-only functions to co_wrapper

2022-11-25 Thread Vladimir Sementsov-Ogievskiy
be removed, and function creation can be offloaded to c_w. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/dirty-bitmap.c | 88 +--- block/meson.build| 1 + include

Re: [PATCH v6 13/14] block: convert bdrv_create to co_wrapper

2022-11-25 Thread Vladimir Sementsov-Ogievskiy
-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy (if you merge 07 here, keep my r-b) -- Best regards, Vladimir

Re: [PATCH v6 12/14] block-coroutine-wrapper.py: support also basic return types

2022-11-25 Thread Vladimir Sementsov-Ogievskiy
per-function custom "ret" field. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/block-gen.h | 5 + scripts/block-coroutine-wrapper.py | 19 +++ 2 files changed, 12 inse

Re: [PATCH v6 11/14] block-coroutine-wrapper.py: default to main loop aiocontext if function does not have a BlockDriverState parameter

2022-11-25 Thread Vladimir Sementsov-Ogievskiy
-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v6 10/14] block-coroutine-wrapper.py: introduce co_wrapper

2022-11-25 Thread Vladimir Sementsov-Ogievskiy
er_mixed() +name = func.co_name +struct_name = func.struct_name +return f"""\ +int {func.name}({ func.gen_list('{decl}') }) +{{ [..] def gen_wrappers(input_code: str) -> str: With at least comments for new functions turned into doc-strings: Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v6 09/14] block: rename generated_co_wrapper in co_wrapper_mixed

2022-11-25 Thread Vladimir Sementsov-Ogievskiy
On 11/25/22 16:35, Emanuele Giuseppe Esposito wrote: In preparation to the incoming new function specifiers, rename g_c_w with a more meaningful name and document it. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v6 08/14] block: bdrv_create_file is a coroutine_fn

2022-11-25 Thread Vladimir Sementsov-Ogievskiy
On 11/25/22 16:35, Emanuele Giuseppe Esposito wrote: It is always called in coroutine_fn callbacks, therefore it can directly call bdrv_co_create(). Rename it to bdrv_co_create_file too. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Kevin Wolf Reviewed-by: Vladimir Sementsov

Re: [PATCH v6 07/14] block: distinguish between bdrv_create running in coroutine and not

2022-11-25 Thread Vladimir Sementsov-Ogievskiy
cal_err); -cco->ret = ret; +cco->ret = bdrv_co_create(cco->drv, cco->filename, cco->opts, >err); We need aio_wait_kick() call here, like in other co_entry() functions. Otherwise we may stuck in aio_poll() with it: Reviewed-by: Vladimir Sementsov-Ogievskiy Hmm actu

Re: [PATCH v6 06/14] block: avoid duplicating filename string in bdrv_create

2022-11-25 Thread Vladimir Sementsov-Ogievskiy
wed-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v6 05/14] block/vmdk: add missing coroutine_fn annotations

2022-11-25 Thread Vladimir Sementsov-Ogievskiy
-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v6 04/14] block-backend: replace bdrv_*_above with blk_*_above

2022-11-25 Thread Vladimir Sementsov-Ogievskiy
and is marked as coroutine_fn, call directly bdrv_co_common_block_status_above() to avoid using a g_c_w. Same applies to blk_co_is_allocated_above. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v6 03/14] nbd/server.c: add missing coroutine_fn annotations

2022-11-25 Thread Vladimir Sementsov-Ogievskiy
ed-by: Paolo Bonzini Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v6 02/14] block-copy: add missing coroutine_fn annotations

2022-11-25 Thread Vladimir Sementsov-Ogievskiy
ine_fn"s. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Paolo Bonzini Reviewed-by: Kevin Wolf change is OK: Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v6 01/14] block-io: introduce coroutine_fn duplicates for bdrv_common_block_status_above callers

2022-11-25 Thread Vladimir Sementsov-Ogievskiy
e from non-coroutine case in g_c_w, create duplicate wrappers that take care of directly calling the same coroutine functions called in the g_c_w. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Kevin Wolf Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

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