qemu/include/migration
Steve Sistare ccfc6715cf migration: cpr_get_fd_param helper
Add the helper function cpr_get_fd_param, to use when preserving
a file descriptor that is opened externally and passed to QEMU.
cpr_get_fd_param returns a descriptor number either from a QEMU
command-line parameter, from a getfd command, or from CPR state.

When a descriptor is passed to new QEMU via SCM_RIGHTS, its number
changes.  Hence, during CPR, the command-line parameter is ignored
in new QEMU, and over-ridden by the value found in CPR state.

Similarly, if the descriptor was originally specified by a getfd
command in old QEMU, the fd number is not known outside of QEMU,
and it changes when sent to new QEMU via SCM_RIGHTS.  Hence the
user cannot send getfd to new QEMU, but when the user sends a
hotplug command that references the fd, cpr_get_fd_param finds
its value in CPR state.

Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/qemu-devel/1751493538-202042-5-git-send-email-steven.sistare@oracle.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2025-07-03 13:42:28 +02:00
..
blocker.h migration: per-mode blockers 2023-11-01 16:13:59 +01:00
client-options.h migration: Add MIG_CMD_SWITCHOVER_START and its load handler 2025-03-06 06:47:33 +01:00
colo.h migration/colo: make colo_incoming_co() return void 2024-05-22 17:34:31 -03:00
cpr.h migration: cpr_get_fd_param helper 2025-07-03 13:42:28 +02:00
cpu.h Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
failover.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
global_state.h migration: never fail in global_state_store() 2023-06-02 01:03:19 +02:00
misc.h migration: Add save_live_complete_precopy_thread handler 2025-03-06 06:47:33 +01:00
qemu-file-types.h migration/qemu-file: add utility methods for working with seekable channels 2024-03-01 15:42:04 +08:00
register.h migration: Add save_postcopy_prepare() savevm handler 2025-05-02 11:09:36 -04:00
snapshot.h migration: preserve suspended for snapshot 2024-01-04 09:52:42 +08:00
vmstate.h migration: lower handler priority 2025-06-11 14:01:58 +02:00