-
Notifications
You must be signed in to change notification settings - Fork 1.2k
runtime-rs: Add vfio support with coldplug for cloud-hypervisor #11540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
dd510dc
to
8d3bf1b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code-wise looking good, some suggestions for managing the commits
@@ -185,8 +185,7 @@ impl CloudHypervisorInner { | |||
} | |||
|
|||
async fn boot_vm(&mut self) -> Result<()> { | |||
let (shared_fs_devices, network_devices) = self.get_shared_devices().await?; | |||
|
|||
let (shared_fs_devices, network_devices, host_devices) = self.get_shared_devices().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we should put this line into the previous commit, otherwise the build breaks if we bisect onto the first commit, write like let (shared_fs_devices, network_devices, _) = self.get_shared_devices().await?;
to silence the warnings
And we change _
to host_devices
here in the second commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch ! thx for this suggestion. fixed
This PR adds support for adding a vfio device before starting the cloud-hypervisor VM (or cold-plug vfio device). This commit changes "pending_devices" for clh implementation via adding DeviceType::Vfio() into pending_devices. And it will get shared host devices after correctly handling vfio devices (Specially for primary device). Signed-off-by: alex.lyn <alex.lyn@antgroup.com> Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
This commit introduce `host_devices` to help convert vfio devices from a generic hypervisor config to a cloud-hypervisor specific VmConfig. Signed-off-by: alex.lyn <alex.lyn@antgroup.com> Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
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 <alex.lyn@antgroup.com> Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
8d3bf1b
to
3fbe493
Compare
runtime-rs: Add vfio support with coldplug for cloud-hypervisor
This PR adds support for adding a vfio device before starting the
cloud-hypervisor VM (or cold-plug vfio device).
In certain high-performance scenarios, users require direct network
device passthrough to achieve superior network performance within
Kata Containers. In Kata's networking model, device passthrough is
facilitated through VFIO , and we need to implement support for this.
Signed-off-by: alex.lyn alex.lyn@antgroup.com
Signed-off-by: Fupan Li fupan.lfp@antgroup.com