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.
When a VM shuts down a virtio-fs device, the worker thread calls
Virtio::reset()
and the BSP thread callsLayoutChanged::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 causeError::InvalidResp
.This commit protects the connection with a mutex to allow only 1 in-flight request.