Skip to content

Popping a desc off of a virtio queue should return an error #1190

Description

@papertigers

Today pop_avail is defined like so:

    /// Accummulates a sequence of available descriptors into a `Chain`.
    ///
    /// VirtIO descriptors can be organized into a linked list
    pub fn pop_avail(
        &self,
        chain: &mut Chain,
        mem: &MemCtx,
    ) -> Option<(u16, u32)>

This function likely needs to return Result<Option<(u16, u32), VqError> so we can appropriately handle invalid host/guest state. This means when we detect invalid data from a guest we need to inform the guest that the device needs a reset.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions