rust-vmm / vfio

14 stars 20 forks source link

RFC: New APIs for vfio-ioctls #9

Closed liuw closed 2 years ago

liuw commented 2 years ago

Summary of the PR

While trying to make Cloud Hypervisor work for KVM and MSHV at the same time, I realize that leaking dependent types is a bad idea. That requires library users to provide different code paths depending on the features.

This PR provides a vfio-ioctls wrapper type which can hold either a KVM DeviceFd or MSHV DeviceFd. Unfortunately these are breaking changes.

Since I'm making breaking changes anyway, I slip in an extra patch to make a DeviceFd optional. This makes this crate useful for people who wants VFIO but have no need for a VM.

Requirements

Before submitting your PR, please make sure you addressed the following requirements:

liuw commented 2 years ago

@jinankjain @russell-islam I realize I made a mistake in the first patch. The code should skip the call instead of returning an error. I've reworked the code. Please take a look.

liuw commented 2 years ago

Build kite CI is still failing

That's because the changes dropped the coverage but then there is no new functionality added.

jinankjain commented 2 years ago

@liuw There is a clippy issue with nohv configuration.

liuw commented 2 years ago

@liuw There is a clippy issue with nohv configuration.

It turns out trying to unify test and non-test configurations requires more work than I have time for right now. I just dropped the last two patches.

liuw commented 2 years ago

@jiangliu @sameo I've merged this PR. It unblocks a large batch of patches on Cloud Hypervisor's side. If you have follow-up comments, I will address them in subsequent PRs.