From 3fbe493edcea5ed626b0a2dd8eb2101f03795b1c Mon Sep 17 00:00:00 2001 From: "alex.lyn" Date: Wed, 9 Jul 2025 11:35:51 +0800 Subject: [PATCH] runtime-rs: Convert host devices within VmConfig for cloud-hypervisor This PR adds support for adding a network device before starting the cloud-hypervisor VM. This commit will get the host devices from NamedHypervisorConfig and assign it to VmConfig's devices which is for vfio devices when clh starts launching. And with this, it successfully finish the vfio devices conversion from a generic Hypervisor config to a clh specific VmConfig. Signed-off-by: alex.lyn Signed-off-by: Fupan Li --- src/runtime-rs/crates/hypervisor/ch-config/src/convert.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/runtime-rs/crates/hypervisor/ch-config/src/convert.rs b/src/runtime-rs/crates/hypervisor/ch-config/src/convert.rs index 09c14d7b67..6e7b6fef79 100644 --- a/src/runtime-rs/crates/hypervisor/ch-config/src/convert.rs +++ b/src/runtime-rs/crates/hypervisor/ch-config/src/convert.rs @@ -109,6 +109,7 @@ impl TryFrom for VmConfig { let fs = n.shared_fs_devices; let net = n.network_devices; + let host_devices = n.host_devices; let cpus = CpusConfig::try_from((cfg.cpu_info, guest_protection_to_use.clone())) .map_err(VmConfigError::CPUError)?; @@ -197,6 +198,7 @@ impl TryFrom for VmConfig { payload, fs, net, + devices: host_devices, pmem, disks, vsock: Some(vsock),