Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to using rust-vmm's vhost and vm-virtio #5

Merged
merged 3 commits into from
Oct 2, 2020
Merged

Switch to using rust-vmm's vhost and vm-virtio #5

merged 3 commits into from
Oct 2, 2020

Conversation

slp
Copy link
Member

@slp slp commented Sep 25, 2020

These commits allows vhost-user-backend to switch to rust-vmm's vhost and vm-virtio crates. I've tried to keep the changes at minimal as possible.

There's only one change in the API, which is that the update_memory method from the VhostUserBackend crate now receives an GuestMemoryMmap wrapped within a GuestMemoryAtomic.

GuestMemoryAtomic enables support for mutable memory maps, and also
acts as a convenient wrapper around GuestMemory without its lifetime
restrictions.

Signed-off-by: Sergio Lopez <slp@redhat.com>
The VHOST_USER_SET_VRING_BASE message is only intended to update the
index for the next descriptor in the available ring.

Signed-off-by: Sergio Lopez <slp@redhat.com>
The main change is that Queue now requires a type parameter of
something that implements GuestAddressSpace. As we already switched to
using GuestMemoryAtomic in a previous commit, we just need to add the
annotations.

There's also a minor change to access Queue::next_avail using
accessors instead of the field.

Signed-off-by: Sergio Lopez <slp@redhat.com>
@slp
Copy link
Member Author

slp commented Sep 30, 2020

@sameo @rbradford Do we want this PR here, or do you prefer to do this directly within rust-vmm?

@rbradford
Copy link
Member

@slp Here is probably best. cloud-hypervisor/cloud-hypervisor needs to switch too as I don't think we can really handle depending on two different versions of the same crate!

@slp
Copy link
Member Author

slp commented Oct 2, 2020

@rbradford OK, I'll wait for this to get reviewed here. BTW, we're a bit in a hurry as we need this, along with vhost and vm-virtio as foundation for vhost-user-fs.

@sameo sameo merged commit 9e8f1e6 into cloud-hypervisor:master Oct 2, 2020
jiangliu pushed a commit that referenced this pull request Aug 12, 2021
Fixes #5

Signed-off-by: Sergio Lopez <slp@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants