Skip to content

Commit e206668

Browse files
committed
feat: kick vsock during VM resume
We need to kick vsock queue during resume in order for a VM to process `TRANSPORT_RESET_EVENT` we sent during snapshot creation. Otherwise it will wait for it forever. Signed-off-by: Egor Lazarchuk <[email protected]>
1 parent 2914d5a commit e206668

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/vmm/src/device_manager/mmio.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,18 @@ impl MMIODeviceManager {
486486
// so for Vsock we don't support connection persistence through snapshot.
487487
// Any in-flight packets or events are simply lost.
488488
// Vsock is restored 'empty'.
489+
// The only reason we still `kick` it is to make guest process
490+
// `TRANSPORT_RESET_EVENT` event we sent during snapshot creation.
491+
let vsock = virtio
492+
.as_mut_any()
493+
.downcast_mut::<crate::devices::virtio::vsock::Vsock<
494+
crate::devices::virtio::vsock::VsockUnixBackend,
495+
>>()
496+
.unwrap();
497+
if vsock.is_activated() {
498+
info!("kick vsock {id}.");
499+
vsock.signal_used_queue().unwrap();
500+
}
489501
}
490502
TYPE_RNG => {
491503
let entropy = virtio.as_mut_any().downcast_mut::<Entropy>().unwrap();

0 commit comments

Comments
 (0)