[RFC] Make Xen and non-Xen worlds compatible #325
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of the PR
[ based on rust-vmm/vm-memory#317 ]
Fix up the xen feature such that compiling with
--feature xen
allows serving both xen and non-xen VMMs. Whether or not we are dealing with a xen frontend is determined by inspecting the control messages (if the xen fields are around, then constructGuestRegionXen', otherwise just use plain old
GuestRegionMmap` (unix)).The first 4 commits are just cleanups that could probably be merged as is, but I'm not too sure whether they mess up the crates' API or not.
As for how to test this, you'll need a
[patch.crates-io]
for vm-memory pointed to a checkout of the above PR, with vm-memory's Cargo.toml fixed up to pretend to be version 0.16.2.I also had a quick go at compile testing this against vhost-device, but vmm-sys-util incompatibilities were the only errors I got (apart from some needed changes from GuestMemoryMmap to GuestMemoryCollection).
Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s
), and the commit message has max 60 characters for thesummary and max 75 characters for each description line.
test.
Release" section of CHANGELOG.md (if no such section exists, please create one).
unsafe
code is properly documented.