-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
virtio-device: extend VirtioDeviceActions Trait
This commit 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: - `read_config` and `write_config`: These methods are invoked when the driver intends to read from or write to the device configuration space. Given that the device configuration space can be managed by various handlers outside of the VMM, such as vhost or vhost-user, dedicated logic is necessary to handle these operations. - `negotiate_driver_features`: This method is called when the driver finishes the negotiation of the driver features with the frontend device (selecting page 0). This method is crucial when the device handler is implemented outside of the VMM since the frontend device needs to negotiate the features with the backend device. Otherwise, the device will not be prepared to support some driver features. - `interrupt_status`: When the driver requires reading the interrupt status from the device, this method is invoked. Since the responsibility for managing interrupt status lies with the frontend device, specialized logic is needed to update the interrupt status appropriately (Used Buffer Notification or Configuration Change Notification). If the device is implemented within the VMM, the interrupt status is direct management and updating by the device. Signed-off-by: joaopeixoto13 <joaopeixotooficial@gmail.com>
- Loading branch information
1 parent
563ac82
commit b801a26
Showing
1 changed file
with
65 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters