Skip to content

Commit 6fb64d7

Browse files
committed
fix(vsock): save state after sending a notification
Implements firecracker-microvm#4812
1 parent 0248907 commit 6fb64d7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/vmm/src/device_manager/persist.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,6 @@ impl<'a> Persist<'a> for MMIODeviceManager {
293293
.downcast_mut::<Vsock<VsockUnixBackend>>()
294294
.unwrap();
295295

296-
let vsock_state = VsockState {
297-
backend: vsock.backend().save(),
298-
frontend: vsock.save(),
299-
};
300-
301296
// Send Transport event to reset connections if device
302297
// is activated.
303298
if vsock.is_activated() {
@@ -306,6 +301,13 @@ impl<'a> Persist<'a> for MMIODeviceManager {
306301
});
307302
}
308303

304+
// Save state after potential notification to the guest. This
305+
// way we save changes to the queue the notification can cause.
306+
let vsock_state = VsockState {
307+
backend: vsock.backend().save(),
308+
frontend: vsock.save(),
309+
};
310+
309311
states.vsock_device = Some(ConnectedVsockState {
310312
device_id: devid.clone(),
311313
device_state: vsock_state,

0 commit comments

Comments
 (0)