Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,17 +233,21 @@ pub struct EmulatedDeviceConfig {
}

/// A part of `AxVMConfig`, which represents the configuration of a pass-through device for a virtual machine.
#[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)]
#[derive(Debug, Default, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct PassThroughDeviceConfig {
/// The name of the device.
pub name: String,
/// The base GPA (Guest Physical Address) of the device.
#[serde(default)]
pub base_gpa: usize,
/// The base HPA (Host Physical Address) of the device.
#[serde(default)]
pub base_hpa: usize,
/// The address length of the device.
#[serde(default)]
pub length: usize,
/// The IRQ (Interrupt Request) ID of the device.
#[serde(default)]
pub irq_id: usize,
}

Expand Down Expand Up @@ -339,6 +343,9 @@ pub struct VMDevicesConfig {
/// How the VM should handle interrupts and interrupt controllers.
#[serde(default)]
pub interrupt_mode: VMInterruptMode,
///we would not like to pass through devices
#[serde(default)]
pub excluded_devices: Vec<Vec<String>>,
}

/// The configuration structure for the guest VM serialized from a toml file provided by user,
Expand Down
1 change: 1 addition & 0 deletions src/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ pub fn get_vm_config_template(
emu_devices: vec![], // No emulated devices by default
passthrough_devices: vec![], // No passthrough devices by default
interrupt_mode: Default::default(), // Use default interrupt mode
excluded_devices: vec![], // No excluded devices by default
},
}
}