Steve Sistare <steven.sist...@oracle.com> writes:

> 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.sist...@oracle.com>

Reviewed-by: Fabiano Rosas <faro...@suse.de>

Reply via email to