Re: [PATCH v4 3/3] qapi: introduce device-sync-config

2024-05-01 Thread Vladimir Sementsov-Ogievskiy
On 30.04.24 11:31, Vladimir Sementsov-Ogievskiy wrote: On 30.04.24 11:19, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Add command to sync config from vhost-user backend to the device. It may be helpful when VHOST_USER_SLAVE_CONFIG_CHANGE_MSG failed or not triggered

Re: [PATCH v6 4/5] migration: process_incoming_migration_co(): rework error reporting

2024-05-01 Thread Vladimir Sementsov-Ogievskiy
On 30.04.24 12:16, Philippe Mathieu-Daudé wrote: On 30/4/24 10:56, Vladimir Sementsov-Ogievskiy wrote: Unify error reporting in the function. This simplifies the following commit, which will not-exit-on-error behavior variant to the function. Signed-off-by: Vladimir Sementsov-Ogievskiy

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

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

[PATCH] iotests/pylintrc: allow up to 10 similar lines

2024-04-30 Thread Vladimir Sementsov-Ogievskiy
: add backup-discard-source" Signed-off-by: Vladimir Sementsov-Ogievskiy --- Hi all! That's a patch to unblock my PR "[PULL 0/6] Block jobs patches for 2024-04-29" <20240429115157.2260885-1-vsement...@yandex-team.ru> https://patchew.org/QEMU/20240429115157.2260885-1

[PATCH v6 4/5] migration: process_incoming_migration_co(): rework error reporting

2024-04-30 Thread Vladimir Sementsov-Ogievskiy
Unify error reporting in the function. This simplifies the following commit, which will not-exit-on-error behavior variant to the function. Signed-off-by: Vladimir Sementsov-Ogievskiy --- migration/migration.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff

[PATCH v6 1/5] migration: move trace-point from migrate_fd_error to migrate_set_error

2024-04-30 Thread Vladimir Sementsov-Ogievskiy
Cover more cases by trace-point. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu --- migration/migration.c | 4 +++- migration/trace-events | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration

[PATCH v6 5/5] qapi: introduce exit-on-error parameter for migrate-incoming

2024-04-30 Thread Vladimir Sementsov-Ogievskiy
the behavior of x-exit-preconfig, it should be another patch. Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Markus Armbruster --- migration/migration-hmp-cmds.c | 2 +- migration/migration.c | 33 +++-- migration/migration.h | 3 +++ qapi

[PATCH v6 2/5] migration: process_incoming_migration_co(): complete cleanup on failure

2024-04-30 Thread Vladimir Sementsov-Ogievskiy
Make call to migration_incoming_state_destroy(), instead of doing only partial of it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas Reviewed-by: Peter Xu --- migration/migration.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/migration

[PATCH v6 0/5] migration: do not exit on incoming failure

2024-04-30 Thread Vladimir Sementsov-Ogievskiy
Hi all! The series brings an option to not immediately exit on incoming migration failure, giving a possibility to orchestrator to get the error through QAPI and shutdown QEMU by "quit". v6: 01,02: add r-b by Peter 03: only fix potential use-after-free 04: rework error handling, drop r-b v5: -

[PATCH v6 3/5] migration: process_incoming_migration_co(): fix reporting s->error

2024-04-30 Thread Vladimir Sementsov-Ogievskiy
It's bad idea to leave critical section with error object freed, but s->error still set, this theoretically may lead to use-after-free crash. Let's avoid it. Signed-off-by: Vladimir Sementsov-Ogievskiy --- migration/migration.c | 1 + 1 file changed, 1 insertion(+) diff --git a/migrat

Re: [PATCH v5 3/5] migration: process_incoming_migration_co(): fix reporting s->error

2024-04-30 Thread Vladimir Sementsov-Ogievskiy
On 30.04.24 11:09, Vladimir Sementsov-Ogievskiy wrote: On 30.04.24 11:06, Vladimir Sementsov-Ogievskiy wrote: On 29.04.24 22:32, Peter Xu wrote: On Mon, Apr 29, 2024 at 10:14:24PM +0300, Vladimir Sementsov-Ogievskiy wrote: It's bad idea to leave critical section with error object freed, but s

Re: [PATCH v4 3/3] qapi: introduce device-sync-config

2024-04-30 Thread Vladimir Sementsov-Ogievskiy
On 30.04.24 11:19, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Add command to sync config from vhost-user backend to the device. It may be helpful when VHOST_USER_SLAVE_CONFIG_CHANGE_MSG failed or not triggered interrupt to the guest or just not available (not supported

Re: [PATCH v4 2/3] vhost-user-blk: split vhost_user_blk_sync_config()

2024-04-30 Thread Vladimir Sementsov-Ogievskiy
On 30.04.24 11:15, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Split vhost_user_blk_sync_config() out from vhost_user_blk_handle_config_change(), to be reused in the following commit. Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/block/vhost-user-blk.c | 26

Re: [PATCH v5 3/5] migration: process_incoming_migration_co(): fix reporting s->error

2024-04-30 Thread Vladimir Sementsov-Ogievskiy
On 30.04.24 11:06, Vladimir Sementsov-Ogievskiy wrote: On 29.04.24 22:32, Peter Xu wrote: On Mon, Apr 29, 2024 at 10:14:24PM +0300, Vladimir Sementsov-Ogievskiy wrote: It's bad idea to leave critical section with error object freed, but s->error still set, this theoretically may lead to

Re: [PATCH v5 3/5] migration: process_incoming_migration_co(): fix reporting s->error

2024-04-30 Thread Vladimir Sementsov-Ogievskiy
On 29.04.24 22:32, Peter Xu wrote: On Mon, Apr 29, 2024 at 10:14:24PM +0300, Vladimir Sementsov-Ogievskiy wrote: It's bad idea to leave critical section with error object freed, but s->error still set, this theoretically may lead to use-after-free crash. Let's avoid it. Signed-off-by: Vladi

Re: [PATCH v5 4/5] migration: process_incoming_migration_co(): rework error reporting

2024-04-30 Thread Vladimir Sementsov-Ogievskiy
On 29.04.24 22:39, Peter Xu wrote: On Mon, Apr 29, 2024 at 10:14:25PM +0300, Vladimir Sementsov-Ogievskiy wrote: Unify error reporting in the function. This simplifies the following commit, which will not-exit-on-error behavior variant to the function. Signed-off-by: Vladimir Sementsov

[PATCH v5 1/5] migration: move trace-point from migrate_fd_error to migrate_set_error

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
Cover more cases by trace-point. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas --- migration/migration.c | 4 +++- migration/trace-events | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index

[PATCH v5 0/5] migration: do not exit on incoming failure

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
Hi all! The series brings an option to not immediately exit on incoming migration failure, giving a possibility to orchestrator to get the error through QAPI and shutdown QEMU by "quit". v5: - add "migration: process_incoming_migration_co(): fix reporting s->error" v4: - add r-b and a-b by

[PATCH v5 4/5] migration: process_incoming_migration_co(): rework error reporting

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
Unify error reporting in the function. This simplifies the following commit, which will not-exit-on-error behavior variant to the function. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas --- migration/migration.c | 17 ++--- 1 file changed, 10 insertions

[PATCH v5 3/5] migration: process_incoming_migration_co(): fix reporting s->error

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
It's bad idea to leave critical section with error object freed, but s->error still set, this theoretically may lead to use-after-free crash. Let's avoid it. Signed-off-by: Vladimir Sementsov-Ogievskiy --- migration/migration.c | 24 1 file changed, 12 insertions(+),

[PATCH v5 2/5] migration: process_incoming_migration_co(): complete cleanup on failure

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
Make call to migration_incoming_state_destroy(), instead of doing only partial of it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas --- migration/migration.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/migration/migration.c b/migration

[PATCH v5 5/5] qapi: introduce exit-on-error parameter for migrate-incoming

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
the behavior of x-exit-preconfig, it should be another patch. Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Markus Armbruster --- migration/migration-hmp-cmds.c | 2 +- migration/migration.c | 38 +++--- migration/migration.h | 3 +++ qapi

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

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
[Add John] On 29.04.24 17:18, Richard Henderson wrote: On 4/29/24 04:51, Vladimir Sementsov-Ogievskiy wrote: Add test for a new backup option: discard-source. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fiona Ebner Tested-by: Fiona Ebner Message-Id: <20240313152822.62649

Re: [PATCH v3 4/4] qapi: introduce exit-on-error parameter for migrate-incoming

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
On 29.04.24 16:06, Fabiano Rosas wrote: Vladimir Sementsov-Ogievskiy writes: On 25.04.24 23:30, Fabiano Rosas wrote: @@ -797,13 +801,18 @@ fail: MIGRATION_STATUS_FAILED); migration_incoming_state_destroy(); -if (migrate_has_error(s

Re: [PATCH] block/copy-before-write: use uint64_t for timeout in nanoseconds

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
the subject helps to understand:   Use uint64_t for timeout in nanoseconds ... Oh, sorry. I'll try to remember that for the future. Should I re-send as a v2? Not necessary, I can touch up the message when applying to my block branch. Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best

Re: [PATCH v3 4/5] qapi: introduce device-sync-config

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
On 29.04.24 16:04, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: On 29.04.24 13:51, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: On 24.04.24 14:48, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Add command to sync config from vhost-user

Re: [PATCH v3 4/5] qapi: introduce device-sync-config

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
On 29.04.24 13:51, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: On 24.04.24 14:48, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Add command to sync config from vhost-user backend to the device. It may be helpful when VHOST_USER_SLAVE_CONFIG_CHANGE_MSG

Re: [PULL 0/6] Block jobs patches for 2024-04-29

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
Sorry for too much CC-ing, I've mistakenly added --cc-cmd=./scripts/get_maintainer.pl On 29.04.24 14:51, Vladimir Sementsov-Ogievskiy wrote: The following changes since commit fd87be1dada5672f877e03c2ca8504458292c479: Merge tag 'accel-20240426' of https://github.com/philmd/qemu

[PULL 4/6] block/copy-before-write: create block_copy bitmap in filter node

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
-Ogievskiy Reviewed-by: Fiona Ebner Tested-by: Fiona Ebner Message-Id: <20240313152822.626493-4-vsement...@yandex-team.ru> Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/block-copy.c | 3 +- block/copy-before-write.c | 2 +- include/block/block-copy.h | 1 + tests/qemu-iotes

[PULL 5/6] qapi: blockdev-backup: add discard-source parameter

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fiona Ebner Tested-by: Fiona Ebner Acked-by: Markus Armbruster Message-Id: <20240313152822.626493-5-vsement...@yandex-team.ru> Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/backup.c | 5 +++--

[PULL 3/6] block/copy-before-write: support unligned snapshot-discard

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
First thing that crashes on unligned access here is bdrv_reset_dirty_bitmap(). Correct way is to align-down the snapshot-discard request. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fiona Ebner Tested-by: Fiona Ebner Message-Id: <20240313152822.626493-3-vsement...@yandex-team

[PULL 2/6] block/copy-before-write: fix permission

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
t...@openvz.org/ [2] https://patchew.org/QEMU/2023101718.932733-1-vsement...@yandex-team.ru/ Signed-off-by: Vladimir Sementsov-Ogievskiy Tested-by: Fiona Ebner Message-Id: <20240313152822.626493-2-vsement...@yandex-team.ru> Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/copy-b

[PULL 1/6] blockcommit: Reopen base image as RO after abort

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
ans RW mode If the base image is in RW mode at the end of blockcommit and was in RO mode before blockcommit, reopen the base BDS in RO. Signed-off-by: Alexander Ivanov Reviewed-by: Vladimir Sementsov-Ogievskiy Message-Id: <20240404091136.129811-1-alexander.iva...@virtuozzo.com> Signed

[PULL 0/6] Block jobs patches for 2024-04-29

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
base image as RO after abort Alexander Ivanov (1): blockcommit: Reopen base image as RO after abort Vladimir Sementsov-Ogievskiy (5): block/copy-before-write: fix permission block/copy-before-write: support unligned

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

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
Add test for a new backup option: discard-source. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fiona Ebner Tested-by: Fiona Ebner Message-Id: <20240313152822.626493-6-vsement...@yandex-team.ru> Signed-off-by: Vladimir Sementsov-Ogievskiy --- .../qemu-iotests/tests/backup-d

[PATCH v4 1/3] qdev-monitor: add option to report GenericError from find_device_state

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
of DeviceNotFound anyway - also, nothing prevent simply copy-pasting find_device_state() calls with false argument Signed-off-by: Vladimir Sementsov-Ogievskiy --- system/qdev-monitor.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/system/qdev-monitor.c b

[PATCH v4 0/3] vhost-user-blk: live resize additional APIs

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
v4: Fixes 01-02 from v3 are already merged. 02: new, split out from 03 03: refacting vhost_user_blk_handle_config_change() split out to 02 drop current_run_state_str() helper some rewordings (Markus) Vladimir Sementsov-Ogievskiy (3): qdev-monitor: add option to report GenericError from

[PATCH v4 2/3] vhost-user-blk: split vhost_user_blk_sync_config()

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
Split vhost_user_blk_sync_config() out from vhost_user_blk_handle_config_change(), to be reused in the following commit. Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/block/vhost-user-blk.c | 26 +++--- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/hw

[PATCH v4 3/3] qapi: introduce device-sync-config

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
the sync only in RUNNING state. Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/block/vhost-user-blk.c | 1 + hw/virtio/virtio-pci.c| 9 include/hw/qdev-core.h| 3 +++ qapi/qdev.json| 23 +++ system/qdev-monitor.c | 48

Re: [PATCH v3 5/5] qapi: introduce CONFIG_READ event

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
On 24.04.24 15:11, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Send a new event when guest reads virtio-pci config after virtio_notify_config() call. That's useful to check that guest fetched modified config, for example after resizing disk backend. Signed-off-by: Vladimir

Re: [PATCH v3 4/5] qapi: introduce device-sync-config

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
On 24.04.24 14:48, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Add command to sync config from vhost-user backend to the device. It may be helpful when VHOST_USER_SLAVE_CONFIG_CHANGE_MSG failed or not triggered interrupt to the guest or just not available (not supported

[PATCH v4 4/4] qapi: introduce exit-on-error parameter for migrate-incoming

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
the behavior of x-exit-preconfig, it should be another patch. Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Markus Armbruster --- migration/migration-hmp-cmds.c | 2 +- migration/migration.c | 36 -- migration/migration.h | 3 +++ qapi

[PATCH v4 3/4] migration: process_incoming_migration_co(): rework error reporting

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
Unify error reporting in the function. This simplifies the following commit, which will not-exit-on-error behavior variant to the function. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas --- migration/migration.c | 20 +++- 1 file changed, 11 insertions

[PATCH v4 1/4] migration: move trace-point from migrate_fd_error to migrate_set_error

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
Cover more cases by trace-point. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas --- migration/migration.c | 4 +++- migration/trace-events | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index

[PATCH v4 2/4] migration: process_incoming_migration_co(): complete cleanup on failure

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
Make call to migration_incoming_state_destroy(), instead of doing only partial of it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Fabiano Rosas --- migration/migration.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/migration/migration.c b/migration

[PATCH v4 0/4] migration: do not exit on incoming failure

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
Hi all! The series brings an option to not immediately exit on incoming migration failure, giving a possibility to orchestrator to get the error through QAPI and shutdown QEMU by "quit". v4: - add r-b and a-b by Fabiano and Markus - improve wording in 04 as Markus suggested v3: - don't refactor

Re: [PATCH v3 4/4] qapi: introduce exit-on-error parameter for migrate-incoming

2024-04-29 Thread Vladimir Sementsov-Ogievskiy
On 25.04.24 23:30, Fabiano Rosas wrote: @@ -797,13 +801,18 @@ fail: MIGRATION_STATUS_FAILED); migration_incoming_state_destroy(); -if (migrate_has_error(s)) { -WITH_QEMU_LOCK_GUARD(>error_mutex) { -error_report_err(s->error); +if

[PATCH v3 4/4] qapi: introduce exit-on-error parameter for migrate-incoming

2024-04-25 Thread Vladimir Sementsov-Ogievskiy
the behavior of x-exit-preconfig, it should be another patch. Signed-off-by: Vladimir Sementsov-Ogievskiy --- migration/migration-hmp-cmds.c | 2 +- migration/migration.c | 36 -- migration/migration.h | 3 +++ qapi/migration.json| 7

[PATCH v3 0/4] migration: do not exit on incoming failure

2024-04-25 Thread Vladimir Sementsov-Ogievskiy
Hi all! The series brings an option to not immediately exit on incoming migration failure, giving a possibility to orchestrator to get the error through QAPI and shutdown QEMU by "quit". v3: - don't refactor the whole code around setting migration error, it seems too much and necessary for the

[PATCH v3 1/4] migration: move trace-point from migrate_fd_error to migrate_set_error

2024-04-25 Thread Vladimir Sementsov-Ogievskiy
Cover more cases by trace-point. Signed-off-by: Vladimir Sementsov-Ogievskiy --- migration/migration.c | 4 +++- migration/trace-events | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index b5af6b5105..2dc6a063e9 100644

[PATCH v3 2/4] migration: process_incoming_migration_co(): complete cleanup on failure

2024-04-25 Thread Vladimir Sementsov-Ogievskiy
Make call to migration_incoming_state_destroy(), instead of doing only partial of it. Signed-off-by: Vladimir Sementsov-Ogievskiy --- migration/migration.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 2dc6a063e9

[PATCH v3 3/4] migration: process_incoming_migration_co(): rework error reporting

2024-04-25 Thread Vladimir Sementsov-Ogievskiy
Unify error reporting in the function. This simplifies the following commit, which will not-exit-on-error behavior variant to the function. Signed-off-by: Vladimir Sementsov-Ogievskiy --- migration/migration.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff

Re: [PATCH v2 1/2] migration: rework migrate_set_error() to migrate_report_err()

2024-04-25 Thread Vladimir Sementsov-Ogievskiy
On 25.04.24 00:52, Peter Xu wrote: On Wed, Apr 24, 2024 at 10:50:14PM +0300, Vladimir Sementsov-Ogievskiy wrote: On 24.04.24 22:40, Peter Xu wrote: On Wed, Apr 24, 2024 at 08:42:44PM +0300, Vladimir Sementsov-Ogievskiy wrote: 1. Most of callers want to free the error after call. Let's help

Re: [PATCH v2 1/2] migration: rework migrate_set_error() to migrate_report_err()

2024-04-24 Thread Vladimir Sementsov-Ogievskiy
On 24.04.24 22:40, Peter Xu wrote: On Wed, Apr 24, 2024 at 08:42:44PM +0300, Vladimir Sementsov-Ogievskiy wrote: 1. Most of callers want to free the error after call. Let's help them. 2. Some callers log the error, some not. We also have places where we log the stored error. Let's instead

Re: [PATCH] tests/avocado: add hotplug_blk test

2024-04-24 Thread Vladimir Sementsov-Ogievskiy
ping!) -- Best regards, Vladimir

[PATCH v2 0/2] migration: do not exit on incoming failure

2024-04-24 Thread Vladimir Sementsov-Ogievskiy
Hi all! The series brings an option to not immediately exit on incoming migration failure, giving a possibility to orchestrator to get the error through QAPI and shutdown QEMU by "quit". Vladimir Sementsov-Ogievskiy (2): migration: rework migrate_set_error() to migrate_report_er

[PATCH v2 1/2] migration: rework migrate_set_error() to migrate_report_err()

2024-04-24 Thread Vladimir Sementsov-Ogievskiy
it to migrate_set_error(). In the new helper let's get the state automatically. Signed-off-by: Vladimir Sementsov-Ogievskiy --- migration/migration.c| 48 migration/migration.h| 2 +- migration/multifd.c | 18 ++- migration/postcopy

[PATCH v2 2/2] qapi: introduce exit-on-error paramter for migrate-incoming

2024-04-24 Thread Vladimir Sementsov-Ogievskiy
an unstable command. Signed-off-by: Vladimir Sementsov-Ogievskiy --- migration/migration-hmp-cmds.c | 2 +- migration/migration.c | 31 +-- migration/migration.h | 3 +++ qapi/migration.json| 7 ++- system/vl.c

Re: [PATCH for-9.1] util/log: add cleanup function

2024-04-24 Thread Vladimir Sementsov-Ogievskiy
On 22.04.24 22:29, Stefan Hajnoczi wrote: On Wed, Apr 17, 2024 at 09:33:33PM +0300, Vladimir Sementsov-Ogievskiy wrote: We leak global_filename, and do not close global_file. Let's fix that. What is the goal? Leaking global_filename does not cause unbounded memory consumption. I guess

Re: [PATCH] migration: do not exit on incoming failure

2024-04-18 Thread Vladimir Sementsov-Ogievskiy
On 18.04.24 18:43, Daniel P. Berrangé wrote: On Thu, Apr 18, 2024 at 06:40:38PM +0300, Vladimir Sementsov-Ogievskiy wrote: On 18.04.24 17:37, Daniel P. Berrangé wrote: On Thu, Apr 18, 2024 at 01:13:29AM +0300, Vladimir Sementsov-Ogievskiy wrote: We do set MIGRATION_FAILED state, but don't

Re: [PATCH] migration: do not exit on incoming failure

2024-04-18 Thread Vladimir Sementsov-Ogievskiy
On 18.04.24 17:37, Daniel P. Berrangé wrote: On Thu, Apr 18, 2024 at 01:13:29AM +0300, Vladimir Sementsov-Ogievskiy wrote: We do set MIGRATION_FAILED state, but don't give a chance to orchestrator to query migration state and get the error. Let's report an error through QAPI like we do

Re: [PATCH] migration: do not exit on incoming failure

2024-04-18 Thread Vladimir Sementsov-Ogievskiy
On 18.04.24 17:27, Fabiano Rosas wrote: Vladimir Sementsov-Ogievskiy writes: We do set MIGRATION_FAILED state, but don't give a chance to orchestrator to query migration state and get the error. Let's report an error through QAPI like we do on outgoing migration. migration-test is updated

[PATCH] migration: do not exit on incoming failure

2024-04-17 Thread Vladimir Sementsov-Ogievskiy
We do set MIGRATION_FAILED state, but don't give a chance to orchestrator to query migration state and get the error. Let's report an error through QAPI like we do on outgoing migration. migration-test is updated correspondingly. Signed-off-by: Vladimir Sementsov-Ogievskiy --- Doubt

[PATCH for-9.1] util/log: add cleanup function

2024-04-17 Thread Vladimir Sementsov-Ogievskiy
We leak global_filename, and do not close global_file. Let's fix that. Signed-off-by: Vladimir Sementsov-Ogievskiy --- Interesting: seems, nobody is maintainer of util/log.c util/log.c | 9 + 1 file changed, 9 insertions(+) diff --git a/util/log.c b/util/log.c index d36c98da0b

Re: [PATCH v5 2/2] nbd/server: Mark negotiation functions as coroutine_fn

2024-04-10 Thread Vladimir Sementsov-Ogievskiy
On 09.04.24 18:49, Eric Blake wrote: On Tue, Apr 09, 2024 at 09:30:39AM +0300, Vladimir Sementsov-Ogievskiy wrote: On 08.04.24 19:00, Eric Blake wrote: nbd_negotiate() is already marked coroutine_fn. And given the fix in the previous patch to have nbd_negotiate_handle_starttls not create

[PATCH] tests/avocado: add hotplug_blk test

2024-04-09 Thread Vladimir Sementsov-Ogievskiy
Introduce a test, that checks that plug/unplug of virtio-blk device works. (the test is developed by copying hotplug_cpu.py, so keep original copyright) Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/avocado/hotplug_blk.py | 69 1 file changed, 69

Re: [PATCH v5 2/2] nbd/server: Mark negotiation functions as coroutine_fn

2024-04-09 Thread Vladimir Sementsov-Ogievskiy
static functions reachable only during option negotiation as also being coroutine_fn. Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Eric Blake --- nbd/server.c | 102 +-- 1 file changed, 59 insertions(+), 43 deletions(-) diff --git a/nbd

Re: [PATCH v5 1/2] nbd/server: do not poll within a coroutine context

2024-04-09 Thread Vladimir Sementsov-Ogievskiy
Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH v4] nbd/server: do not poll within a coroutine context

2024-04-08 Thread Vladimir Sementsov-Ogievskiy
ation") Signed-off-by: Zhu Yangyang [eblake: move callbacks to their use point] Signed-off-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy still, some notes below --- v3: https://lists.gnu.org/archive/html/qemu-devel/2024-04/msg00375.html in v4, factor even the struct to th

Re: [PATCH v3] nbd/server: do not poll within a coroutine context

2024-04-05 Thread Vladimir Sementsov-Ogievskiy
On 04.04.24 04:42, Eric Blake wrote: From: Zhu Yangyang Coroutines are not supposed to block. Instead, they should yield. The client performs TLS upgrade outside of an AIOContext, during synchronous handshake; this still requires g_main_loop. But the server responds to TLS upgrade inside a

Re: [PATCH v4 0/5] backup: discard-source parameter

2024-04-05 Thread Vladimir Sementsov-Ogievskiy
On 13.03.24 18:28, Vladimir Sementsov-Ogievskiy wrote: Hi all! The main patch is 04, please look at it for description and diagram. v4: add t-b by Fiona add r-b by Fiona to 02-05 (patch 01 still lack an r-b) 05: fix copyrights and subject in the test 04: since 9.0 --> since

Re: [PATCH v5] blockcommit: Reopen base image as RO after abort

2024-04-05 Thread Vladimir Sementsov-Ogievskiy
02140002 < The last 2 means RW mode If the base image is in RW mode at the end of blockcommit and was in RO mode before blockcommit, reopen the base BDS in RO. Signed-off-by: Alexander Ivanov Reviewed-by: Vladimir Sementsov-Ogievskiy Thanks, applied to my block branch. -- Best regards, Vladimir

Re: [PATCH 06/19] block/stream: fix -Werror=maybe-uninitialized false-positives

2024-04-03 Thread Vladimir Sementsov-Ogievskiy
On 03.04.24 20:50, Eric Blake wrote: On Wed, Apr 03, 2024 at 01:24:11PM +0400, Marc-André Lureau wrote: Unfortunately, it doesn't work in all cases. It seems to have issues with some guards: ../block/stream.c: In function ‘stream_run’: ../block/stream.c:216:12: error: ‘ret’ may be used

Re: [PATCH 06/19] block/stream: fix -Werror=maybe-uninitialized false-positives

2024-04-03 Thread Vladimir Sementsov-Ogievskiy
On 03.04.24 11:11, Marc-André Lureau wrote: Hi On Tue, Apr 2, 2024 at 11:24 PM Vladimir Sementsov-Ogievskiy wrote: On 02.04.24 18:34, Eric Blake wrote: On Tue, Apr 02, 2024 at 12:58:43PM +0300, Vladimir Sementsov-Ogievskiy wrote: Again, same false-positives, because

Re: [PATCH v2 2/4] mirror: allow specifying working bitmap

2024-04-02 Thread Vladimir Sementsov-Ogievskiy
On 07.03.24 16:47, Fiona Ebner wrote: From: John Snow for the mirror job. The bitmap's granularity is used as the job's granularity. The new @bitmap parameter is marked unstable in the QAPI and can currently only be used for @sync=full mode. Clusters initially dirty in the bitmap as well as

Re: [PATCH 06/19] block/stream: fix -Werror=maybe-uninitialized false-positives

2024-04-02 Thread Vladimir Sementsov-Ogievskiy
On 02.04.24 18:34, Eric Blake wrote: On Tue, Apr 02, 2024 at 12:58:43PM +0300, Vladimir Sementsov-Ogievskiy wrote: Again, same false-positives, because of WITH_GRAPH_RDLOCK_GUARD().. Didn't you try to change WITH_ macros somehow, so that compiler believe in our good intentions? #define

Re: [PATCH 06/19] block/stream: fix -Werror=maybe-uninitialized false-positives

2024-04-02 Thread Vladimir Sementsov-Ogievskiy
On 02.04.24 12:12, Marc-André Lureau wrote: Hi On Fri, Mar 29, 2024 at 12:35 PM Vladimir Sementsov-Ogievskiy wrote: On 28.03.24 13:20, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau ../block/stream.c:193:19: error: ‘unfiltered_bs’ may be used uninitialized [-Werror=maybe

Re: [PATCH v2 1/4] qapi/block-core: avoid the re-use of MirrorSyncMode for backup

2024-04-01 Thread Vladimir Sementsov-Ogievskiy
in mirror_start(). Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Fiona Ebner Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [PATCH for-9.1] migration: Add Error** argument to add_bitmaps_to_list()

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
On 29.03.24 13:56, Cédric Le Goater wrote: This allows to report more precise errors in the migration handler dirty_bitmap_save_setup(). Suggested-by Vladimir Sementsov-Ogievskiy Signed-off-by: Cédric Le Goater Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

[PATCH v3 4/5] qapi: introduce device-sync-config

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
the sync only in RUNNING state. Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/block/vhost-user-blk.c | 27 -- hw/virtio/virtio-pci.c| 9 include/hw/qdev-core.h| 3 +++ include/sysemu/runstate.h | 1 + qapi/qdev.json| 21

[PATCH v3 5/5] qapi: introduce CONFIG_READ event

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
Send a new event when guest reads virtio-pci config after virtio_notify_config() call. That's useful to check that guest fetched modified config, for example after resizing disk backend. Signed-off-by: Vladimir Sementsov-Ogievskiy --- hw/virtio/virtio-pci.c | 9 + include/monitor

[PATCH v3 0/5] vhost-user-blk: live resize additional APIs

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
v3: 02: add r-b by Markus 03: improve commit message 04: improve documentation, merge race-fix here (which was v2:05), rebase on master (migration_is_running() now without arguments) 05: improve documentation Vladimir Sementsov-Ogievskiy (5): vhost-user-blk: simplify and fix

[PATCH v3 1/5] vhost-user-blk: simplify and fix vhost_user_blk_handle_config_change

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
reason to create extra branches in the logic. Signed-off-by: Vladimir Sementsov-Ogievskiy Acked-by: Raphael Norwitz --- hw/block/vhost-user-blk.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index 6a856a

[PATCH v3 2/5] qdev-monitor: fix error message in find_device_state()

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
This "hotpluggable" here is misleading. Actually we check is object a device or not. Let's drop the word. Suggested-by: Markus Armbruster Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Markus Armbruster --- system/qdev-monitor.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH v3 3/5] qdev-monitor: add option to report GenericError from find_device_state

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
of DeviceNotFound anyway - also, nothing prevent simply copy-pasting find_device_state() calls with false argument Signed-off-by: Vladimir Sementsov-Ogievskiy --- system/qdev-monitor.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/system/qdev-monitor.c b

Re: [PATCH for-9.1 v5 07/14] migration: Add Error** argument to .save_setup() handler

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
On 29.03.24 13:53, Cédric Le Goater wrote: Hello Vladimir, On 3/29/24 10:32, Vladimir Sementsov-Ogievskiy wrote: On 20.03.24 09:49, Cédric Le Goater wrote: diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c index 2708abf3d762de774ed294d3fdb8e56690d2974c

Re: [PATCH 2/2] backup: add minimum cluster size to performance options

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
to the backup source will too. If the granularity is too small, they will just be aligned down in cbw_co_pdiscard_snapshot() and thus effectively ignored. Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Fiona Ebner --- block/backup.c| 2 +- block/copy-before-write.c | 2

Re: [PATCH 1/2] copy-before-write: allow specifying minimum cluster size

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
node will too. If the granularity is too small, they will just be aligned down in cbw_co_pdiscard_snapshot() and thus effectively ignored. The QAPI uses uint32 so the value will be non-negative, but still fit into a uint64_t. Suggested-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Fiona Ebner

Re: [PATCH for-9.1 v5 07/14] migration: Add Error** argument to .save_setup() handler

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
quot;Failed to initialize migration of block dirty bitmaps". with this, for block dirty bitmap migration: Acked-by: Vladimir Sementsov-Ogievskiy Still, a lot better is add errp to init_dirty_bitmap_migration() and to add_bitmaps_to_list() too: look, init_dirty_bitmap_migration() fails only

Re: [PATCH v4] blockcommit: Reopen base image as RO after abort

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
} + All looks good to me except this: seems it is safer to place this "if" block before "bdrv_drained_end(); bdrv_unref();" above. With it moved: Reviewed-by: Vladimir Sementsov-Ogievskiy bs_opaque->job = NULL; bdrv_drained_end(src); @@

Re: [PATCH 06/19] block/stream: fix -Werror=maybe-uninitialized false-positives

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
, "unused variable initialization" is bad thing too. Anyway, if no better solution for now: Acked-by: Vladimir Sementsov-Ogievskiy --- block/stream.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/stream.c b/block/stream.c index 7031eef12b..9076203

Re: [PATCH 05/19] block/mirror: fix -Werror=maybe-uninitialized false-positive

2024-03-29 Thread Vladimir Sementsov-Ogievskiy
unconditionally. Probably we should mention this in a comment. Signed-off-by: Marc-André Lureau Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/mirror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/mirror.c b/block/mirror.c index 1bdce3b657..53dd7332ee

Re: [RFC 04/15] qapi: block-job-change: make copy-mode parameter optional

2024-03-28 Thread Vladimir Sementsov-Ogievskiy
On 28.03.24 12:24, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: We are going to add more parameters to change. We want to make possible to change only one or any subset of available options. So all the options should be optional. Signed-off-by: Vladimir Sementsov-Ogievskiy

Re: [RFC 01/15] scripts/qapi: support type-based unions

2024-03-28 Thread Vladimir Sementsov-Ogievskiy
On 28.03.24 12:15, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Look at block-job-change command: we have to specify both 'id' to chose the job to operate on and 'type' for QAPI union be parsed. But for user this looks redundant: when we specify 'id', QEMU should be able

Re: [RFC 01/15] scripts/qapi: support type-based unions

2024-03-28 Thread Vladimir Sementsov-Ogievskiy
On 28.03.24 12:40, Markus Armbruster wrote: Subject: all unions are type-based. Perhaps "support implicit union tags on the wire"? Yes, sounds good. Do you need this schema language feature for folding block jobs into the jobs abstraction, or is it just for making the wire protocol nicer

Re: [PATCH] qapi/block-core: improve Qcow2OverlapCheckFlags documentation

2024-03-25 Thread Vladimir Sementsov-Ogievskiy
On 25.03.24 16:04, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Most of fields have no description at all. Let's fix that. Still, no reason to place here more detailed descriptions of what these structures are, as we have public Qcow2 format specification. Signed-off

[PATCH] qapi/block-core: improve Qcow2OverlapCheckFlags documentation

2024-03-25 Thread Vladimir Sementsov-Ogievskiy
Most of fields have no description at all. Let's fix that. Still, no reason to place here more detailed descriptions of what these structures are, as we have public Qcow2 format specification. Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 25 + 1

Re: qemu fuzz crash in virtio_net_queue_reset()

2024-03-22 Thread Vladimir Sementsov-Ogievskiy
On 22.03.24 05:17, Xuan Zhuo wrote: On Wed, 20 Mar 2024 00:24:37 +0300, "Vladimir Sementsov-Ogievskiy" wrote: Hi all! From fuzzing I've got a fuzz-data, which produces the following crash: qemu-fuzz-x86_64: ../hw/net/virtio-net.c:134: void flush_or_purge_queued_packets(NetC

Re: qemu fuzz crash in virtio_net_queue_reset()

2024-03-21 Thread Vladimir Sementsov-Ogievskiy
On 21.03.24 18:01, Alexander Bulekov wrote: On 240320 0024, Vladimir Sementsov-Ogievskiy wrote: Hi all! From fuzzing I've got a fuzz-data, which produces the following crash: qemu-fuzz-x86_64: ../hw/net/virtio-net.c:134: void flush_or_purge_queued_packets(NetClientState *): Assertion

qemu fuzz crash in virtio_net_queue_reset()

2024-03-19 Thread Vladimir Sementsov-Ogievskiy
Hi all! From fuzzing I've got a fuzz-data, which produces the following crash: qemu-fuzz-x86_64: ../hw/net/virtio-net.c:134: void flush_or_purge_queued_packets(NetClientState *): Assertion `!virtio_net_get_subqueue(nc)->async_tx.elem' failed. ==2172308== ERROR: libFuzzer: deadly signal #0

  1   2   3   4   5   6   7   8   9   10   >