google / alioth

Experimental KVM-based type-2 hypervisor in Rust implemented from scratch.
Apache License 2.0
160 stars 10 forks source link

fix(vu): allow only 1 in-flight request #104

Closed Lencerf closed 3 months ago

Lencerf commented 3 months ago

When a VM shuts down a virtio-fs device, the worker thread calls Virtio::reset() and the BSP thread calls LayoutChanged::ram_removed(). Both of them send requests over the UDS connection and compete with each other. Backend replies are not guaranteed to come in order, which could cause Error::InvalidResp.

This commit protects the connection with a mutex to allow only 1 in-flight request.