firecracker_rs_sdk/models/
memory_backend.rs

1use std::path::PathBuf;
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
6pub struct MemoryBackend {
7    #[serde(rename = "backend_type")]
8    pub backend_type: BackendType,
9    /// Based on 'backend_type' it is either
10    /// 1) Path to the file that contains the guest memory to be loaded
11    /// 2) Path to the UDS where a process is listening for a UFFD initialization
12    /// control payload and open file descriptor that it can use to serve this
13    /// process's guest memory page faults
14    #[serde(rename = "backend_path")]
15    pub backend_path: PathBuf,
16}
17
18#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
19pub enum BackendType {
20    #[serde(rename = "File")]
21    File,
22    #[serde(rename = "Uffd")]
23    Uffd,
24}