cloud-hypervisor / cloud-hypervisor

A Virtual Machine Monitor for modern Cloud workloads. Features include CPU, memory and device hotplug, support for running Windows and Linux guests, device offload with vhost-user and a minimal compact footprint. Written in Rust with a strong focus on security.
https://www.cloudhypervisor.org
3.85k stars 435 forks source link

Move Cloud Hypervisor to virtio-vsock crate from rust-vmm #3822

Open sboeuf opened 2 years ago

sboeuf commented 2 years ago

In order to share the maximum amount of code with the upstream regarding the virtio-vsock device, it'd be good to move the codebase to the upstream crate https://github.com/rust-vmm/vm-virtio/tree/main/crates/devices/virtio-vsock

andreeaflorescu commented 2 years ago

We still have to upstream a few things, so far we only got the packet implementation. The other ones will follow soon.

sboeuf commented 2 years ago

Yes of course, but I wanted to start tracking this :)

sboeuf commented 2 years ago

@andreeaflorescu is someone actively working on the virtio-vsock crate to make it ready to be pulled by external projects?

andreeaflorescu commented 2 years ago

@sboeuf we already published the vsock-packet sub-component from virtio-vsock. The other ones will follow in the next couple of months. We want to finish the upstreaming for them by the end of 2022. If you'd like you can consume vsock-packet already, otherwise you can also wait for the other ones to be published.

lkml-likexu commented 1 year ago

Hi @likebreath @stefano-garzarella

I noticed that the Virtio-VSOCK feature stops working if a v6.3+ guest kernel is booted with the v33.0 CH.

This is due to the kernel commit 71dc9ec9ac7d ("virtio/vsock: replace virtio_vsock_pkt with sk_buff"), and CH's virtio-vsock backend crate has none support for parsing the new struct sk_buff. In that case, the endless WARN log "WARN --- virtio-devices/src/vsock/device.rs:146 -- vsock: RX queue error: BufDescMissing" is easily triggered with documented steps in the docs/vsock.md.

I'd like to know your thoughts on addressing this bug, an important issue here is how to get the CH backend to maintain compatibility in parsing different formats for guests with unspecified kernel versions.

stefano-garzarella commented 1 year ago

Hi @lkml-likexu, it looks like the same issue we fixed in rust-vmm's vsock crate: https://github.com/rust-vmm/vm-virtio/issues/204