Closed germag closed 8 months ago
/cc @XanClic
The compiled version of the documentation linked in patch 1 is here: https://qemu-project.gitlab.io/qemu/interop/vhost-user.html
Looks good to me, thanks!
@XanClic thanks!
Looks good also to me!
v2:
Rebase
Summary of the PR
A new set of messages have been introduced in the vhost-user protocol to support the migration of devices with back-end's internal state[0].
These are the additions to the protocol:
VHOST_USER_PROTOCOL_F_DEVICE_STATE
SET_DEVICE_STATE_FD
function: Front-end and back-end negotiate a file descriptor over which to transfer the state. It also includes establishing the direction of transfer and migration phase.CHECK_DEVICE_STATE
: After the state has been transferred through the file descriptor, the front-end invokes this function to verify success. There is no in-band way (through the file descriptor) to indicate failure, so we need to check explicitly.[0] https://github.com/qemu/qemu/commit/019233096c03b826e0e677115b6e3c550a54a48d
This code is part of the effort to support live migration in virtiofsd and is currently being used in a version of virtiofsd that supports migration: https://gitlab.com/virtiofsd-live-migration
Note to reviewers
~Please do not merge this PR yet, this PR depends on https://github.com/rust-vmm/vhost/pull/202, because by adding
FrontendReq::SET_DEVICE_STATE_FD
a "hole" was created in value41
, this makes the APi unsound, sinceVhostUserMsgHeader::get_code()
calltransmute_copy()
which assumes that the values are continuous and have no "holes" between them.~~I'll rebase and adjust the code after PR 202 gets merged.~