vmm: config: Switch NetConfig to use PciDeviceCommonConfig

Switch NetConfig 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 11:49:54 -07:00
parent d2ce7667bc
commit 92c2cf0103
5 changed files with 61 additions and 61 deletions

View File

@@ -1879,7 +1879,9 @@ impl RequestHandler for Vmm {
for net in restored_nets.iter() {
for net_config in vm_net_configs.iter_mut() {
// update only if the net dev is backed by FDs
if net_config.id.as_ref() == Some(&net.id) && net_config.fds.is_some() {
if net_config.pci_common.id.as_ref() == Some(&net.id)
&& net_config.fds.is_some()
{
net_config.fds.clone_from(&net.fds);
}
}