Skip to content
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

virtio-device: extend VirtioDeviceActions Trait #291

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Oct 10, 2024

  1. virtio-device: extend VirtioDeviceActions trait

    This commit enhances the VirtioDeviceActions Trait to accommodate Vhost
    and Vhost-User devices effectively. It introduces four new methods to
    the VirtioDeviceActions trait to facilitate seamless interaction with
    these devices:
    
    - `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-user when the protocol
    feature CONFIG is negotiated, dedicated logic is necessary to handle
    these operations (e.g. GET_CONFIG/SET_CONFIG requests).
    - `negotiate_driver_features`:  This method is called when the driver
    finishes the negotiation of the device 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, for example,
    multiple queues and configuration space reads and writes.
    - `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: João Peixoto <[email protected]>
    joaopeixoto13 committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    8b2214b View commit details
    Browse the repository at this point in the history