[PATCH V9 02/46] memory: RAM_NAMED_FILE flag

2022-07-26 Thread Steve Sistare
also test this flag, for similar reasons. Signed-off-by: Steve Sistare --- backends/hostmem-file.c | 1 + include/exec/memory.h | 3 +++ include/exec/ram_addr.h | 1 + migration/ram.c | 3 ++- softmmu/physmem.c | 7 ++- 5 files changed, 13 insertions(+), 2 deletions(-) diff

[PATCH V9 12/46] qapi: QAPI_LIST_LENGTH

2022-07-26 Thread Steve Sistare
Signed-off-by: Steve Sistare Reviewed-by: Marc-André Lureau --- include/qapi/util.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/qapi/util.h b/include/qapi/util.h index 7d88b09..75dddca 100644 --- a/include/qapi/util.h +++ b/include/qapi/util.h @@ -65,4 +65,17

[PATCH V9 04/46] migration: mode parameter

2022-07-26 Thread Steve Sistare
'info migrate' command. Signed-off-by: Steve Sistare --- hw/core/qdev-properties-system.c| 12 include/hw/qdev-properties-system.h | 4 include/migration/misc.h| 4 migration/migration.c | 28 monitor/

[PATCH V9 01/46] migration: fix populate_vfio_info

2022-07-26 Thread Steve Sistare
Include CONFIG_DEVICES so that populate_vfio_info is instantiated for CONFIG_VFIO. Fixes: 43bd0bf30f ("migration: Move populate_vfio_info() into a separate file") Signed-off-by: Steve Sistare Reviewed-by: Marc-André Lureau --- migration/target.c | 1 + 1 file changed, 1 insertio

[PATCH V9 14/46] qapi: strList unit tests

2022-07-26 Thread Steve Sistare
Signed-off-by: Steve Sistare Reviewed-by: Marc-André Lureau --- MAINTAINERS | 6 tests/unit/meson.build| 1 + tests/unit/test-strlist.c | 81 +++ 3 files changed, 88 insertions(+) create mode 100644 tests/unit/test-strlist.c

[PATCH V9 00/46] Live Update

2022-07-26 Thread Steve Sistare
on - add mode and cpr-exec-args migration parameters - add per-mode migration blockers - add mode checks in migration notifiers - fix suspended runstate during migration - replace RAM_ANON flag with RAM_NAMED_FILE - support memory-backend-epc Steve Sistare (44): migration: f

[PATCH V9 03/46] migration: file URI

2022-07-26 Thread Steve Sistare
Extend the migration URI to support file:. This can be used for any migration scenario that does not require a reverse path. It is easier to use than the fd: URI. It can be use in HMP commands, and as a qemu command-line parameter. Signed-off-by: Steve Sistare --- migration/file.c | 62

[PATCH V9 06/46] migration: simplify blockers

2022-07-26 Thread Steve Sistare
will allow one Error blocker to be registered for multiple migration modes. No functional change. Signed-off-by: Steve Sistare --- backends/tpm/tpm_emulator.c | 10 ++ block/parallels.c| 6 ++ block/qcow.c | 6 ++ block/vdi.c | 6

[PATCH V9 18/46] memory: flat section iterator

2022-07-26 Thread Steve Sistare
Add an iterator over the sections of a flattened address space. Signed-off-by: Steve Sistare Reviewed-by: Marc-André Lureau --- include/exec/memory.h | 31 +++ softmmu/memory.c | 21 + 2 files changed, 52 insertions(+) diff --git a/include

[PATCH V9 19/46] oslib: qemu_clear_cloexec

2022-07-26 Thread Steve Sistare
Define qemu_clear_cloexec, analogous to qemu_set_cloexec. Signed-off-by: Steve Sistare Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Marc-André Lureau --- include/qemu/osdep.h | 9 + util/oslib-posix.c | 9 + util/oslib-win32.c | 4 3 files changed, 22 insertions

[PATCH V9 22/46] cpr: exec mode

2022-07-26 Thread Steve Sistare
pabilities related to page and block copy, and the implementation ignores all related parameters. Cpr-exec mode supports memory-backend-memfd, memory-backend-epc, and vfio devices in subsequent patches. Signed-off-by: Steve Sistare --- MAINTAINERS | 2 ++ include/migration/cpr.h | 1

[PATCH V9 13/46] qapi: strv_from_strList

2022-07-26 Thread Steve Sistare
Signed-off-by: Steve Sistare Reviewed-by: Marc-André Lureau --- include/qapi/util.h | 6 ++ qapi/qapi-util.c| 14 ++ 2 files changed, 20 insertions(+) diff --git a/include/qapi/util.h b/include/qapi/util.h index 75dddca..51ff64e 100644 --- a/include/qapi/util.h +++ b

[PATCH V9 33/46] vfio-pci: cpr part 3 (intx)

2022-07-26 Thread Steve Sistare
initialization, but still perform kvm initialization. Signed-off-by: Steve Sistare --- hw/vfio/pci.c | 81 --- 1 file changed, 61 insertions(+), 20 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 1d0e8db..906e3cb 100644 --- a

[PATCH V9 21/46] cpr: preserve extra state

2022-07-26 Thread Steve Sistare
associated with any registered object, and serialize the aux state to a memfd file. Deserialize after qemu restarts, before devices are realized. The following state is saved: * cpr mode * file descriptor names and values * memfd values and properties for ram blocks Signed-off-by: Steve Sistare

[PATCH V9 32/46] vfio-pci: cpr part 2 (msi)

2022-07-26 Thread Steve Sistare
Finish cpr for vfio-pci MSI/MSI-X devices by preserving eventfd's and vector state. Signed-off-by: Steve Sistare --- hw/vfio/pci.c | 119 +- 1 file changed, 118 insertions(+), 1 deletion(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c

[PATCH V9 30/46] vfio-pci: refactor for cpr

2022-07-26 Thread Steve Sistare
Refactor vector use into a helper vfio_vector_init. Add vfio_notifier_init and vfio_notifier_cleanup for named notifiers, and pass additional arguments to vfio_remove_kvm_msi_virq. All for use by cpr in a subsequent patch. No functional change. Signed-off-by: Steve Sistare --- hw/vfio/pci.c

[PATCH V9 27/46] hostmem-memfd: cpr support

2022-07-26 Thread Steve Sistare
Preserve memory-backend-memfd memory objects during cpr. Signed-off-by: Steve Sistare --- backends/hostmem-memfd.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/backends/hostmem-memfd.c b/backends/hostmem-memfd.c index 3fc85c3..d421a4f 100644 --- a

[PATCH V9 05/46] migration: migrate-enable-mode option

2022-07-26 Thread Steve Sistare
a mode is not blocked. Signed-off-by: Steve Sistare --- include/migration/misc.h | 2 ++ migration/migration.c| 31 +++ qemu-options.hx | 10 ++ softmmu/vl.c | 4 4 files changed, 47 insertions(+) diff --git a/include/migratio

[PATCH V9 24/46] cpr: ram block blockers

2022-07-26 Thread Steve Sistare
Unlike cpr-reboot mode, cpr-exec mode cannot save volatile ram blocks in the migration stream file and recreate them later, because the physical memory for the blocks is pinned and registered for vfio. Add an exec-mode blocker for volatile ram blocks. Signed-off-by: Steve Sistare --- include

[PATCH V9 38/46] chardev: cpr for pty

2022-07-26 Thread Steve Sistare
Save and restore pty descriptors across cpr-exec. Signed-off-by: Steve Sistare --- chardev/char-pty.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/chardev/char-pty.c b/chardev/char-pty.c index 53f25c6..5707b13 100644 --- a/chardev/char-pty.c +++ b/chardev

[PATCH V9 29/46] pci: export msix_is_pending

2022-07-26 Thread Steve Sistare
Export msix_is_pending for use by cpr. No functional change. Signed-off-by: Steve Sistare Acked-by: Michael S. Tsirkin --- hw/pci/msix.c | 2 +- include/hw/pci/msix.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/pci/msix.c b/hw/pci/msix.c index 1e381a9

[PATCH V9 34/46] vfio-pci: recover from unmap-all-vaddr failure

2022-07-26 Thread Steve Sistare
new "remap" flag that tells it to restore a mapping without re-allocating new userland data structures. Signed-off-by: Steve Sistare --- hw/vfio/common.c | 79 ++- hw/vfio/cpr.c | 36 include/hw

[PATCH V9 20/46] vl: helper to request re-exec

2022-07-26 Thread Steve Sistare
Add a qemu_system_exec_request() hook that causes the main loop to exit and re-exec qemu using the specified arguments. Signed-off-by: Steve Sistare --- include/sysemu/runstate.h | 1 + softmmu/runstate.c| 24 2 files changed, 25 insertions(+) diff --git a

[PATCH V9 25/46] cpr: only-cpr-capable

2022-07-26 Thread Steve Sistare
Add the only-cpr-capable option, which causes qemu to exit with an error if any devices that are not capable of cpr are added. This guarantees that the migrate commanmd will not fail due to a blocker. Signed-off-by: Steve Sistare --- include/migration/cpr.h | 2 ++ migration/migration.c

[PATCH V9 44/46] migration: fix suspended runstate

2022-07-26 Thread Steve Sistare
guest, as vm_start was never called during this invocation of qemu. To fix, leave the guest in the suspended state, but call qemu_system_start_on_wakeup_request() so the guest is properly resumed when the client sends a system_wakeup command. Signed-off-by: Steve Sistare --- migration/migration.c

[PATCH V9 28/46] hostmem-epc: cpr support

2022-07-26 Thread Steve Sistare
Preserve memory-backend-epc memory objects during cpr. Signed-off-by: Steve Sistare --- backends/hostmem-epc.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/backends/hostmem-epc.c b/backends/hostmem-epc.c index 037292d..c6b1fe4 100644 --- a/backends

[PATCH V9 16/46] migration: simplify notifiers

2022-07-26 Thread Steve Sistare
Pass the callback function to add_migration_state_change_notifier so that migration can initialize the notifier on add and clear it on delete, which simplifies the call sites. Also shorten the function names. No functional change. Signed-off-by: Steve Sistare --- hw/net/virtio-net.c | 6

[PATCH V9 08/46] cpr: relax some blockers

2022-07-26 Thread Steve Sistare
modes when they are added in subsequent patches. No functional change until a new mode is added. Signed-off-by: Steve Sistare --- backends/tpm/tpm_emulator.c | 3 ++- block/parallels.c | 3 ++- block/qcow.c| 3 ++- block/vdi.c | 3 ++- block/vhdx.c

[PATCH V9 10/46] qdev-properties: strList

2022-07-26 Thread Steve Sistare
Define a list-of-strings property, to be used for the cpr-exec-args migration property in a subsequent patch. Signed-off-by: Steve Sistare --- hw/core/qdev-properties.c| 44 include/hw/qdev-properties.h | 3 +++ 2 files changed, 47 insertions

[PATCH V9 42/46] tests/avocado: add cpr regression test

2022-07-26 Thread Steve Sistare
Signed-off-by: Steve Sistare --- MAINTAINERS | 1 + tests/avocado/cpr.py | 176 +++ 2 files changed, 177 insertions(+) create mode 100644 tests/avocado/cpr.py diff --git a/MAINTAINERS b/MAINTAINERS index b93b0bb..adc1218 100644 --- a

[PATCH V9 07/46] migration: per-mode blockers

2022-07-26 Thread Steve Sistare
added to multiple lists. When a block is deleted, it is removed from every list, and the Error is freed. No functional change until a new mode is added. Signed-off-by: Steve Sistare --- include/migration/blocker.h | 45 --- migration/migration.c | 87

[PATCH V9 40/46] python/machine: QEMUMachine full_args

2022-07-26 Thread Steve Sistare
-off-by: Steve Sistare --- python/qemu/machine/machine.py | 5 + 1 file changed, 5 insertions(+) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index 37191f4..d05950e 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -332,6

[PATCH V9 09/46] cpr: reboot mode

2022-07-26 Thread Steve Sistare
must be non-volatile across reboot, such as by backing it with a dax device, but this is not enforced. The restarted qemu arguments must match those used to initially start qemu, plus the -incoming option. Signed-off-by: Steve Sistare --- qapi/migration.json | 16 +++- 1 file changed

[PATCH V9 26/46] cpr: Mismatched GPAs fix

2022-07-26 Thread Steve Sistare
occur on the target, causing a "Mismatched GPAs" error during cpr-exec migration. To fix, unconditionally set the target's address to the source's address if the region does not have an address yet. Signed-off-by: Steve Sistare --- include/exec/memory.h | 12 migrat

[PATCH V9 45/46] migration: notifier error reporting

2022-07-26 Thread Steve Sistare
are added. Signed-off-by: Steve Sistare --- include/migration/misc.h | 3 ++- migration/migration.c| 31 +++ 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index d4c2d7d..e5d8c81 100644 --- a/include

[PATCH V9 11/46] qapi: strList_from_string

2022-07-26 Thread Steve Sistare
Generalize strList_from_comma_list() to take any delimiter character, rename as strList_from_string(), and move it to qapi/util.c. No functional change. Signed-off-by: Steve Sistare --- include/qapi/util.h | 9 + monitor/hmp-cmds.c | 31 +++ qapi/qapi

[PATCH V9 41/46] python/machine: QEMUMachine reopen_qmp_connection

2022-07-26 Thread Steve Sistare
Provide reopen_qmp_connection() to reopen a closed monitor connection. This is needed by cpr, because qemu exec closes the monitor socket. Signed-off-by: Steve Sistare --- python/qemu/machine/machine.py | 9 + 1 file changed, 9 insertions(+) diff --git a/python/qemu/machine/machine.py

[PATCH V9 36/46] chardev: cpr framework

2022-07-26 Thread Steve Sistare
. Allow cpr-save if either QEMU_CHAR_FEATURE_CPR or reopen-on-cpr is true for all chardevs in the configuration. Signed-off-by: Steve Sistare --- chardev/char.c | 49 + include/chardev/char.h | 5 + qapi/char.json | 7

[PATCH V9 35/46] vhost: reset vhost devices for cpr

2022-07-26 Thread Steve Sistare
prior to exec. Signed-off-by: Mark Kanda Signed-off-by: Steve Sistare --- hw/virtio/vhost.c | 23 +++ include/hw/virtio/vhost.h | 1 + 2 files changed, 24 insertions(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 8d2a136..bc8df55 100644 --- a/hw/virtio

[PATCH V9 37/46] chardev: cpr for simple devices

2022-07-26 Thread Steve Sistare
Set QEMU_CHAR_FEATURE_CPR for devices that trivially support cpr-exec. char-stdio is slightly less trivial. Allow the gdb server by closing it on exec. Signed-off-by: Steve Sistare --- MAINTAINERS | 1 + chardev/char-mux.c| 1 + chardev/char-null.c | 1 + chardev/char

[PATCH V9 23/46] cpr: add exec-mode blockers

2022-07-26 Thread Steve Sistare
Add blockers for cpr-exec migration mode for devices and options that do not support it. Signed-off-by: Steve Sistare --- accel/xen/xen-all.c | 3 +++ migration/migration.c | 5 + replay/replay.c | 4 3 files changed, 12 insertions(+) diff --git a/accel/xen/xen-all.c b/accel

[PATCH V9 43/46] vl: start on wakeup request

2022-07-26 Thread Steve Sistare
() hook to cause vm_start() to be called when processing the wakeup request. This will be called in a subsequent migration patch. Signed-off-by: Steve Sistare --- include/sysemu/runstate.h | 1 + softmmu/runstate.c| 15 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff

[PATCH V9 46/46] vfio: allow cpr-reboot migration if suspended

2022-07-26 Thread Steve Sistare
store. Relax the vfio blocker, and add a notifier that verifies the guest is suspended. Skip dirty page tracking to avoid ioctl errors. Signed-off-by: Steve Sistare --- hw/vfio/common.c | 8 ++-- hw/vfio/cpr.c | 21 + hw/vfio/migration.c

[PATCH V9 17/46] migration: check mode in notifiers

2022-07-26 Thread Steve Sistare
The existing notifiers should only apply to normal mode. No functional change. Signed-off-by: Steve Sistare --- hw/net/virtio-net.c | 4 hw/vfio/migration.c | 3 +++ ui/spice-core.c | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/net/virtio-net.c b/hw/net

[PATCH V9 39/46] chardev: cpr for sockets

2022-07-26 Thread Steve Sistare
Save accepted socket fds before cpr-exec, and look for them after. Block cpr-exec if a socket enables the TLS or websocket option. Allow a monitor socket by closing it on exec. Signed-off-by: Mark Kanda Signed-off-by: Steve Sistare --- chardev/char-socket.c | 48

[PATCH V9 31/46] vfio-pci: cpr part 1 (fd and dma)

2022-07-26 Thread Steve Sistare
larity. Part 1 handles device file descriptors and DMA. Part 2 adds eventfd and MSI/MSI-X vector support. Part 3 adds INTX support. Signed-off-by: Steve Sistare --- MAINTAINERS | 1 + hw/pci/pci.c | 12 hw/vfio/common.c

[PATCH V9 15/46] migration: cpr-exec-args parameter

2022-07-26 Thread Steve Sistare
Create the cpr-exec-args migration parameter, defined as a list of strings. It will be used for cpr-exec migration mode in a subsequent patch. No functional change, except that cpr-exec-args is shown by the 'info migrate' command. Signed-off-by: Steve Sistare --- hmp-commands.hx

[PATCH V2] migration: export fewer options

2024-02-26 Thread Steve Sistare
necessary few via misc.h, which already exports a portion of the client API. Signed-off-by: Steve Sistare --- Changes in V2: * renamed options-pub.h to client-options.h --- --- hw/vfio/migration.c| 1 - hw/virtio/virtio-balloon.c | 1 - include/migration/client-options.h | 24

[PATCH V1 00/10] privatize migration.h

2024-02-27 Thread Steve Sistare
these fixes, no code outside of migration includes migration.h, and no code outside of migration uses MigrationState. This series depends on the following: * migration patches in the series "allow cpr-reboot for vfio" * singleton patch "migration: export fewer options"

[PATCH V1 02/10] migration: export migration_is_setup_or_active

2024-02-27 Thread Steve Sistare
Delete the MigrationState parameter from migration_is_setup_or_active and move it to the public API in misc.h. Signed-off-by: Steve Sistare --- hw/vfio/common.c | 2 +- include/migration/misc.h | 1 + migration/migration.c| 12 ++-- migration/migration.h| 1

[PATCH V1 04/10] migration: export migration_is_running

2024-02-27 Thread Steve Sistare
Delete the MigrationState parameter from migration_is_running and move it to the public API in misc.h. Signed-off-by: Steve Sistare --- include/migration/misc.h | 1 + migration/migration.c | 10 ++ migration/migration.h | 2 -- migration/options.c| 4

[PATCH V1 03/10] migration: export migration_is_active

2024-02-27 Thread Steve Sistare
Delete the MigrationState parameter from migration_is_active so it can be exported and used without including migration.h. Signed-off-by: Steve Sistare --- hw/vfio/common.c | 4 ++-- include/migration/misc.h | 2 +- migration/migration.c| 10 ++ system/dirtylimit.c

[PATCH V1 05/10] migration: export vcpu_dirty_limit_period

2024-02-27 Thread Steve Sistare
Define and export vcpu_dirty_limit_period to eliminate a dependency on MigrationState. Signed-off-by: Steve Sistare --- include/migration/client-options.h | 1 + migration/options.c| 7 +++ system/dirtylimit.c| 3 +-- 3 files changed, 9 insertions(+), 2

[PATCH V1 08/10] migration: migration_file_set_error

2024-02-27 Thread Steve Sistare
Define and export migration_file_set_error to eliminate a dependency on MigrationState. Signed-off-by: Steve Sistare --- hw/vfio/common.c | 9 + hw/vfio/migration.c | 11 +++ include/migration/misc.h | 2 ++ migration/migration.c| 11 +++ 4 files

[PATCH V1 06/10] migration: migration_thread_is_self

2024-02-27 Thread Steve Sistare
Define and export migration_thread_is_self to eliminate a dependency on MigrationState. Signed-off-by: Steve Sistare --- include/migration/misc.h | 1 + migration/migration.c| 7 +++ system/dirtylimit.c | 5 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a

[PATCH V1 00/10] privatize migration.h

2024-02-27 Thread Steve Sistare
these fixes, no code outside of migration includes migration.h, and no code outside of migration uses MigrationState. This series depends on the following: * migration patches in the series "allow cpr-reboot for vfio" * singleton patch "migration: export fewer options"

[PATCH V1 07/10] migration: migration_is_device

2024-02-27 Thread Steve Sistare
Define and export migration_is_device to eliminate a dependency on MigrationState. Signed-off-by: Steve Sistare --- hw/vfio/common.c | 4 +--- include/migration/misc.h | 1 + migration/migration.c| 7 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/vfio

[PATCH V1 10/10] migration: purge MigrationState from public interface

2024-02-27 Thread Steve Sistare
Delete unused accessors and move remaining MigrationState references from the public file misc.h to the private file migration.h. Signed-off-by: Steve Sistare --- include/migration/misc.h | 9 ++--- migration/migration.c| 10 -- migration/migration.h| 6 ++ 3 files

[PATCH V1 01/10] migration: remove migration.h references

2024-02-27 Thread Steve Sistare
Remove migration.h from files that no longer need it due to previous commits. Signed-off-by: Steve Sistare --- hw/vfio/container.c| 1 - hw/virtio/vhost-user.c | 1 - hw/virtio/virtio-balloon.c | 1 - system/qdev-monitor.c | 1 - target/loongarch/kvm/kvm.c | 1 - tests/unit

[PATCH V1 09/10] migration: privatize colo interfaces

2024-02-27 Thread Steve Sistare
Remove private migration interfaces from net/colo-compare.c and push them to migration/colo.c. Signed-off-by: Steve Sistare --- migration/colo.c | 17 +++-- net/colo-compare.c | 3 +-- stubs/colo.c | 1 - 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a

[PATCH] migration: re-format cpr-reboot documentation

2024-02-29 Thread Steve Sistare
Re-wrap the cpr-reboot documentation to 70 columns, use '@' for cpr-reboot references, and capitalize COLO. Suggested-by: Markus Armbruster Signed-off-by: Steve Sistare --- qapi/migration.json | 36 +++- 1 file changed, 19 insertions(+), 17 deletion

[PATCH V2] migration: massage cpr-reboot documentation

2024-02-29 Thread Steve Sistare
Re-wrap the cpr-reboot documentation to 70 columns, use '@' for cpr-reboot references, capitalize COLO and VFIO, and tweak the wording. Suggested-by: Markus Armbruster Signed-off-by: Steve Sistare --- qapi/migration.json | 36 +++- 1 file changed, 19

[PATCH V4 04/14] migration: MigrationEvent for notifiers

2024-02-22 Thread Steve Sistare
: Steve Sistare Reviewed-by: Peter Xu Reviewed-by: David Hildenbrand --- hw/net/virtio-net.c | 11 ++- hw/vfio/migration.c | 10 +++--- hw/vfio/trace-events | 2 +- include/migration/misc.h | 23 ++- migration/migration.c| 17 - net

[PATCH V4 03/14] migration: convert to NotifierWithReturn

2024-02-22 Thread Steve Sistare
Change all migration notifiers to type NotifierWithReturn, so notifiers can return an error status in a future patch. For now, pass NULL for the notifier error parameter, and do not check the return value. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Reviewed-by: David Hildenbrand

[PATCH V4 01/14] notify: pass error to notifier with return

2024-02-22 Thread Steve Sistare
Pass an error object as the third parameter to "notifier with return" notifiers, so clients no longer need to bundle an error object in the opaque data. The new parameter is used in a later patch. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Reviewed-by: David Hildenbrand ---

[PATCH V4 05/14] migration: remove postcopy_after_devices

2024-02-22 Thread Steve Sistare
postcopy_after_devices and migration_in_postcopy_after_devices are no longer used, so delete them. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu --- include/migration/misc.h | 1 - migration/migration.c| 7 --- migration/migration.h| 2 -- 3 files changed, 10 deletions

[PATCH V4 07/14] migration: per-mode notifiers

2024-02-22 Thread Steve Sistare
Keep a separate list of migration notifiers for each migration mode. Suggested-by: Peter Xu Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Reviewed-by: David Hildenbrand --- include/migration/misc.h | 6 ++ migration/migration.c| 22 +- 2 files changed, 23

[PATCH V4 12/14] vfio: allow cpr-reboot migration if suspended

2024-02-22 Thread Steve Sistare
ch as by issuing guest-suspend-ram to the qemu guest agent. Relax the vfio blocker so it does not apply to cpr, and add a notifier that verifies the guest is suspended. Signed-off-by: Steve Sistare --- hw/vfio/common.c | 2 +- hw/vfio/cpr.c

[PATCH V4 14/14] migration: options incompatible with cpr

2024-02-22 Thread Steve Sistare
Fail the migration request if options are set that are incompatible with cpr. Signed-off-by: Steve Sistare --- migration/migration.c | 17 + qapi/migration.json | 2 ++ 2 files changed, 19 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index 90a9094

[PATCH V4 13/14] migration: update cpr-reboot description

2024-02-22 Thread Steve Sistare
Clarify qapi for cpr-reboot migration mode, and add vfio support. Signed-off-by: Steve Sistare --- qapi/migration.json | 35 ++- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/qapi/migration.json b/qapi/migration.json index 5a565d9..0990297

[PATCH V4 10/14] migration: stop vm for cpr

2024-02-22 Thread Steve Sistare
the RUN_STATE_FINISH_MIGRATE state. Signed-off-by: Steve Sistare --- include/migration/misc.h | 1 + migration/migration.c| 51 +--- migration/migration.h| 2 -- 3 files changed, 32 insertions(+), 22 deletions(-) diff --git a/include

[PATCH V4 09/14] migration: notifier error checking

2024-02-22 Thread Steve Sistare
Check the status returned by migration notifiers for event type MIG_EVENT_PRECOPY_SETUP, and report errors. None of the notifiers return an error status at this time. Signed-off-by: Steve Sistare --- include/migration/misc.h | 8 +++- migration/migration.c| 25

[PATCH V4 06/14] migration: MigrationNotifyFunc

2024-02-22 Thread Steve Sistare
Define MigrationNotifyFunc to improve type safety and simplify migration notifiers. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Reviewed-by: David Hildenbrand --- hw/net/virtio-net.c | 4 +--- hw/vfio/migration.c | 3 +-- include/migration/misc.h | 5 - migration

[PATCH V4 02/14] migration: remove error from notifier data

2024-02-22 Thread Steve Sistare
Remove the error object from opaque data passed to notifiers. Use the new error parameter passed to the notifier instead. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Reviewed-by: David Hildenbrand --- hw/virtio/vhost-user.c | 8 include/migration/misc.h | 1 - migration

[PATCH V4 00/14] allow cpr-reboot for vfio

2024-02-22 Thread Steve Sistare
T_PRECOPY_SETUP may return an error. * doc that a fail event may be sent without a prior setup event Steve Sistare (14): notify: pass error to notifier with return migration: remove error from notifier data migration: convert to NotifierWithReturn migration: MigrationEven

[PATCH V4 08/14] migration: refactor migrate_fd_connect failures

2024-02-22 Thread Steve Sistare
Move common code for the error path in migrate_fd_connect to a shared fail label. No functional change. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Reviewed-by: David Hildenbrand --- migration/migration.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git

[PATCH V4 11/14] vfio: register container for cpr

2024-02-22 Thread Steve Sistare
Define entry points to perform per-container cpr-specific initialization and teardown. Signed-off-by: Steve Sistare --- hw/vfio/container.c | 11 ++- hw/vfio/cpr.c | 19 +++ hw/vfio/iommufd.c | 6 ++ hw/vfio/meson.build

[PATCH V5 4/5] util: strList unit tests

2024-02-22 Thread Steve Sistare
Signed-off-by: Steve Sistare Reviewed-by: Marc-André Lureau --- tests/unit/meson.build| 1 + tests/unit/test-strList.c | 80 +++ 2 files changed, 81 insertions(+) create mode 100644 tests/unit/test-strList.c diff --git a/tests/unit/meson.build

[PATCH V5 3/5] util: strv_from_strList

2024-02-22 Thread Steve Sistare
Signed-off-by: Steve Sistare Reviewed-by: Marc-André Lureau --- include/qemu/strList.h | 6 ++ util/strList.c | 14 ++ 2 files changed, 20 insertions(+) diff --git a/include/qemu/strList.h b/include/qemu/strList.h index 0f26116..c1eb1dd 100644 --- a/include/qemu

[PATCH V5 0/5] string list functions

2024-02-22 Thread Steve Sistare
to exec.c Changes in V4: * added exec migration patch Steve Sistare (5): util: str_split qapi: QAPI_LIST_LENGTH util: strv_from_strList util: strList unit tests migration: simplify exec migration functions include/monitor/hmp.h | 1 - include/qapi/util.h | 13

[PATCH V5 1/5] util: str_split

2024-02-22 Thread Steve Sistare
Generalize hmp_split_at_comma() to take any delimiter string, rename as str_split(), and move it to util/strList.c. No functional change. Signed-off-by: Steve Sistare --- include/monitor/hmp.h | 1 - include/qemu/strList.h | 24 monitor/hmp-cmds.c | 19

[PATCH V5 2/5] qapi: QAPI_LIST_LENGTH

2024-02-22 Thread Steve Sistare
Signed-off-by: Steve Sistare Reviewed-by: Marc-André Lureau --- include/qapi/util.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/qapi/util.h b/include/qapi/util.h index 81a2b13..20dfea8 100644 --- a/include/qapi/util.h +++ b/include/qapi/util.h @@ -56,4 +56,17

[PATCH V5 5/5] migration: simplify exec migration functions

2024-02-22 Thread Steve Sistare
code uses g_steal_pointer which NULLs argv and prevents the destructor from running, but argv is leaked. Fixes: cbab4face57b ("migration: convert exec backend ...") Signed-off-by: Steve Sistare Reviewed-by: Fabiano Rosas --- migration/exec.c | 57 ---

[PATCH V1] migration: export fewer options

2024-02-23 Thread Steve Sistare
necessary few via misc.h, which already exports a portion of the client API. Signed-off-by: Steve Sistare --- I suggest that eventually we should define a single file migration/client.h which exports everything needed by the simpler clients: blockers, notifiers, options, cpr, and state accessors

[PATCH V3 04/13] migration: MigrationEvent for notifiers

2024-02-08 Thread Steve Sistare
: Steve Sistare --- hw/net/virtio-net.c | 11 ++- hw/vfio/migration.c | 10 +++--- hw/vfio/trace-events | 2 +- include/migration/misc.h | 14 +- migration/migration.c| 15 ++- net/vhost-vdpa.c | 6 +++--- ui/spice-core.c | 9

[PATCH V3 06/13] migration: MigrationNotifyFunc

2024-02-08 Thread Steve Sistare
Define MigrationNotifyFunc to improve type safety and simplify migration notifiers. Signed-off-by: Steve Sistare --- hw/net/virtio-net.c | 4 +--- hw/vfio/migration.c | 3 +-- include/migration/misc.h | 7 ++- migration/migration.c| 4 ++-- net/vhost-vdpa.c | 6

[PATCH V3 11/13] vfio: register container for cpr

2024-02-08 Thread Steve Sistare
Define entry points to perform per-container cpr-specific initialization and teardown. Signed-off-by: Steve Sistare --- hw/vfio/container.c | 11 ++- hw/vfio/cpr.c | 19 +++ hw/vfio/iommufd.c | 6 ++ hw/vfio/meson.build

[PATCH V3 03/13] migration: convert to NotifierWithReturn

2024-02-08 Thread Steve Sistare
Change all migration notifiers to type NotifierWithReturn, so notifiers can return an error status in a future patch. For now, pass NULL for the notifier error parameter, and do not check the return value. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu --- hw/net/virtio-net.c

[PATCH V3 01/13] notify: pass error to notifier with return

2024-02-08 Thread Steve Sistare
Pass an error object as the third parameter to "notifier with return" notifiers, so clients no longer need to bundle an error object in the opaque data. The new parameter is used in a later patch. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu --- hw/virtio/vhost-user.c

[PATCH V3 10/13] migration: stop vm for cpr

2024-02-08 Thread Steve Sistare
the RUN_STATE_FINISH_MIGRATE state. Signed-off-by: Steve Sistare --- include/migration/misc.h | 1 + migration/migration.c| 32 +--- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index 6dc234b

[PATCH V3 12/13] vfio: allow cpr-reboot migration if suspended

2024-02-08 Thread Steve Sistare
ch as by issuing guest-suspend-ram to the qemu guest agent. Relax the vfio blocker so it does not apply to cpr, and add a notifier that verifies the guest is suspended. Signed-off-by: Steve Sistare --- hw/vfio/common.c | 2 +- hw/vfio/cpr.c

[PATCH V3 05/13] migration: remove postcopy_after_devices

2024-02-08 Thread Steve Sistare
postcopy_after_devices and migration_in_postcopy_after_devices are no longer used, so delete them. Signed-off-by: Steve Sistare --- include/migration/misc.h | 1 - migration/migration.c| 7 --- migration/migration.h| 2 -- 3 files changed, 10 deletions(-) diff --git a/include

[PATCH V3 02/13] migration: remove error from notifier data

2024-02-08 Thread Steve Sistare
Remove the error object from opaque data passed to notifiers. Use the new error parameter passed to the notifier instead. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu --- hw/virtio/vhost-user.c | 8 include/migration/misc.h | 1 - migration/postcopy-ram.c | 1 - migration

[PATCH V3 09/13] migration: notifier error checking

2024-02-08 Thread Steve Sistare
Check the status returned by migration notifiers and report errors. If notifiers fail, call the notifiers again so they can clean up. None of the notifiers return an error status at this time. Signed-off-by: Steve Sistare --- include/migration/misc.h | 3 ++- migration/migration.c| 40

[PATCH V3 07/13] migration: per-mode notifiers

2024-02-08 Thread Steve Sistare
Keep a separate list of migration notifiers for each migration mode. Suggested-by: Peter Xu Signed-off-by: Steve Sistare --- include/migration/misc.h | 2 ++ migration/migration.c| 22 +- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/include/migration

[PATCH V3 08/13] migration: refactor migrate_fd_connect failures

2024-02-08 Thread Steve Sistare
Move common code for the error path in migrate_fd_connect to a shared fail label. No functional change. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu --- migration/migration.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/migration/migration.c

[PATCH V3 13/13] migration: update cpr-reboot description

2024-02-08 Thread Steve Sistare
Clarify qapi for cpr-reboot migration mode, and add vfio support. Signed-off-by: Steve Sistare --- qapi/migration.json | 36 +++- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/qapi/migration.json b/qapi/migration.json index 8197083..c83e0c0

[PATCH V3 00/13] allow cpr-reboot for vfio

2024-02-08 Thread Steve Sistare
te to tip, add RB's * replace MigrationStatus with new enum MigrationEventType * simplify migrate_fd_connect error recovery * support vfio iommufd containers * add patches: migration: stop vm for cpr migration: update cpr-reboot description Steve Sistare (13): notify: pas

[PATCH V3] migration: export fewer options

2024-03-11 Thread Steve Sistare
necessary few via misc.h, which already exports a portion of the client API. Signed-off-by: Steve Sistare --- Changes in V3: * rebase to migration-next --- --- hw/vfio/migration.c| 1 - hw/virtio/virtio-balloon.c | 1 - include/migration/client-options.h | 24

[PATCH V2 03/11] migration: export migration_is_active

2024-03-11 Thread Steve Sistare
Delete the MigrationState parameter from migration_is_active so it can be exported and used without including migration.h. Signed-off-by: Steve Sistare --- hw/vfio/common.c | 4 ++-- include/migration/misc.h | 2 +- migration/migration.c| 10 ++ system/dirtylimit.c

  1   2   3   4   5   6   7   8   9   10   >