[RFC] Make Xen and non-Xen worlds compatible#325
Draft
roypat wants to merge 5 commits intorust-vmm:mainfrom
Draft
[RFC] Make Xen and non-Xen worlds compatible#325roypat wants to merge 5 commits intorust-vmm:mainfrom
roypat wants to merge 5 commits intorust-vmm:mainfrom
Conversation
Instead of having cfg'd calls to different functions, just directly construct the VhostUserMemoryRegion object. Also convert the conversion to a `From` impl Signed-off-by: Patrick Roy <patrick.roy@linux.dev>
instead of providing cfg'd conversion methods and constructors based on whether the xen feature is enabled, just rely on the existing `From&VhostUserMemoryRegionInfo> for VhostUserMemoryRegion` impl, and add a further from impl to convert to a a `VhostUserSingleMemoryRegion`. Signed-off-by: Patrick Roy <patrick.roy@linux.dev>
VhostUserMemoryRegion::new()/with_xen() were unused / only used in test code, so inline them into the one use-site in test code. Signed-off-by: Patrick Roy <patrick.roy@linux.dev>
Replace some instances of GuestMemoryAtomic<GuestMemoryMmap<B>> with the `GM` type alias. For cases where no bitmap type was specified, add a default type to the type alias we those can just use `GM`. Signed-off-by: Patrick Roy <patrick.roy@linux.dev>
Allow supporting both Xen and non-xen backends when --feature xen is enable (e.g. make the feature additive). Determine whether a memory region is a xen one from the passed vhost messages (e.g. xen_flags and xen_data being != 0). Signed-off-by: Patrick Roy <patrick.roy@linux.dev>
4 tasks
Member
Author
|
(I'll get back to this cover the Christmas break, putting back in draft until then) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 xenallows 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 oldGuestRegionMmap` (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).
unsafecode is properly documented.