disk_backend_resources/
layer.rs1use mesh::MeshPayload;
7use vm_resource::Resource;
8use vm_resource::ResourceId;
9use vm_resource::kind::DiskHandleKind;
10use vm_resource::kind::DiskLayerHandleKind;
11
12#[derive(MeshPayload)]
17pub struct RamDiskLayerHandle {
18 pub len: Option<u64>,
21}
22
23impl ResourceId<DiskLayerHandleKind> for RamDiskLayerHandle {
24 const ID: &'static str = "ram";
25}
26
27#[derive(MeshPayload)]
29pub struct DiskLayerHandle(pub Resource<DiskHandleKind>);
30
31impl ResourceId<DiskLayerHandleKind> for DiskLayerHandle {
32 const ID: &'static str = "disk";
33}
34
35#[derive(MeshPayload)]
37pub struct SqliteDiskLayerFormatParams {
38 pub logically_read_only: bool,
40 pub len: Option<u64>,
43}
44
45#[derive(MeshPayload)]
47pub struct SqliteDiskLayerHandle {
48 pub dbhd_path: String,
50
51 pub format_dbhd: Option<SqliteDiskLayerFormatParams>,
54}
55
56impl ResourceId<DiskLayerHandleKind> for SqliteDiskLayerHandle {
57 const ID: &'static str = "sqlite";
58}
59
60#[derive(MeshPayload)]
63pub struct SqliteAutoCacheDiskLayerHandle {
64 pub cache_path: String,
66 pub cache_key: Option<String>,
69}
70
71impl ResourceId<DiskLayerHandleKind> for SqliteAutoCacheDiskLayerHandle {
72 const ID: &'static str = "sqlite-autocache";
73}