vmm: config: Switch VdpaConfig to use PciDeviceCommonConfig

Switch VdpaConfig over to using the newly extracted struct members as
used by all PCI based devices. The use of #[serde(flatten)] means that
this change has no impact on the JSON format that the data is stored as.

Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
Rob Bradford
2026-04-03 12:14:02 -07:00
parent 2c50be4753
commit ece77c3c52
3 changed files with 23 additions and 47 deletions
+2 -6
View File
@@ -647,15 +647,11 @@ impl ApplyLandlock for UserDeviceConfig {
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub struct VdpaConfig {
#[serde(flatten)]
pub pci_common: PciDeviceCommonConfig,
pub path: PathBuf,
#[serde(default = "default_vdpaconfig_num_queues")]
pub num_queues: usize,
#[serde(default)]
pub iommu: bool,
#[serde(default)]
pub id: Option<String>,
#[serde(default)]
pub pci_segment: u16,
}
pub fn default_vdpaconfig_num_queues() -> usize {