migration: cpr-state
authorSteve Sistare <steven.sistare@oracle.com>
Wed, 15 Jan 2025 19:00:33 +0000 (11:00 -0800)
committerFabiano Rosas <farosas@suse.de>
Wed, 29 Jan 2025 14:43:04 +0000 (11:43 -0300)
commite7d79011a4b2e7bf8f7a0423164b65656d1619d7
treea7bb40e801b343bde6b2819c11ad6b4660af57fa
parent91792807d11cb30021575cec31fd9dd458efba23
migration: cpr-state

CPR must save state that is needed after QEMU is restarted, when devices
are realized.  Thus the extra state cannot be saved in the migration
channel, as objects must already exist before that channel can be loaded.
Instead, define auxilliary state structures and vmstate descriptions, not
associated with any registered object, and serialize the aux state to a
cpr-specific channel in cpr_state_save.  Deserialize in cpr_state_load
after QEMU restarts, before devices are realized.

Provide accessors for clients to register file descriptors for saving.
The mechanism for passing the fd's to the new process will be specific
to each migration mode, and added in subsequent patches.

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Link: https://lore.kernel.org/r/1736967650-129648-8-git-send-email-steven.sistare@oracle.com
Signed-off-by: Fabiano Rosas <farosas@suse.de>
include/migration/cpr.h [new file with mode: 0644]
migration/cpr.c [new file with mode: 0644]
migration/meson.build
migration/migration.c
migration/trace-events