rust-vmm / vm-virtio

virtio implementation
Apache License 2.0
361 stars 87 forks source link

virtio-device: extend VirtioDeviceActions Trait #291

Open joaopeixoto13 opened 5 months ago

joaopeixoto13 commented 5 months ago

Summary of the PR

This PR enhances the VirtioDeviceActions Trait to accommodate Vhost and Vhost-User devices. This way, this crate can be used not only to implement virtio abstractions for devices that are implemented inside the VMM, but it can also serve as a frontend virtio device abstraction for Vhost and Vhost-user type devices. This patch introduces four new methods to the VirtioDeviceActions:

Requirements

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

joaopeixoto13 commented 4 months ago

Update: I already have a raw implementation that allows me to verify the PR to use the VirtioDeviceActions trait to accommodate not only VirtIO backends but also Vhost and Vhost-user backends. In this case, it was tested and proven to work for: VirtIO-Net and VirtIO-Block, Vhost-user-fs and Vhost-vsock.