@@ -16,30 +16,35 @@ use super::*;
1616use crate :: devices:: virtio:: persist:: VirtioDeviceState ;
1717use crate :: devices:: virtio:: { DeviceState , TYPE_VSOCK } ;
1818
19+ /// The Vsock serializable state.
1920// NOTICE: Any changes to this structure require a snapshot version bump.
2021#[ derive( Debug , Clone , Versionize ) ]
2122pub struct VsockState {
23+ /// The vsock backend state.
2224 pub backend : VsockBackendState ,
25+ /// The vsock frontend state.
2326 pub frontend : VsockFrontendState ,
2427}
2528
29+ /// The Vsock frontend serializable state.
2630// NOTICE: Any changes to this structure require a snapshot version bump.
27- /// The Vsock serializable state.
2831#[ derive( Debug , Clone , Versionize ) ]
2932pub struct VsockFrontendState {
33+ /// Context IDentifier.
3034 pub cid : u64 ,
3135 virtio_state : VirtioDeviceState ,
3236}
3337
34- // NOTICE: Any changes to this structure require a snapshot version bump.
3538/// An enum for the serializable backend state types.
39+ // NOTICE: Any changes to this structure require a snapshot version bump.
3640#[ derive( Debug , Clone , Versionize ) ]
3741pub enum VsockBackendState {
42+ /// UDS backend state.
3843 Uds ( VsockUdsState ) ,
3944}
4045
41- // NOTICE: Any changes to this structure require a snapshot version bump.
4246/// The Vsock Unix Backend serializable state.
47+ // NOTICE: Any changes to this structure require a snapshot version bump.
4348#[ derive( Debug , Clone , Versionize ) ]
4449pub struct VsockUdsState {
4550 /// The path for the UDS socket.
@@ -49,14 +54,16 @@ pub struct VsockUdsState {
4954/// A helper structure that holds the constructor arguments for VsockUnixBackend
5055#[ derive( Debug ) ]
5156pub struct VsockConstructorArgs < B > {
57+ /// Pointer to guest memory.
5258 pub mem : GuestMemoryMmap ,
59+ /// The vsock Unix Backend.
5360 pub backend : B ,
5461}
5562
5663/// A helper structure that holds the constructor arguments for VsockUnixBackend
5764#[ derive( Debug ) ]
5865pub struct VsockUdsConstructorArgs {
59- // cid available in VsockFrontendState.
66+ /// cid available in VsockFrontendState.
6067 pub cid : u64 ,
6168}
6269
0 commit comments