rust-vmm / vhost

Apache License 2.0
130 stars 69 forks source link

Add back-end's internal state migration support #203

Closed germag closed 8 months ago

germag commented 10 months ago

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:

[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 value 41, this makes the APi unsound, since VhostUserMsgHeader::get_code() call transmute_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.~

germag commented 10 months ago

/cc @XanClic

XanClic commented 10 months ago

The compiled version of the documentation linked in patch 1 is here: https://qemu-project.gitlab.io/qemu/interop/vhost-user.html

XanClic commented 8 months ago

Looks good to me, thanks!

stefano-garzarella commented 8 months ago

@XanClic thanks!

Looks good also to me!

germag commented 8 months ago

v2:

germag commented 8 months ago

Rebase