Skip to content

virtio: set MmioSlots drop order via code #1116

Description

@luigix25

From kernel/src/virtio/mmio.rs:

    // Fields are ordered so that `mmio_range` is dropped last.
    // The MmioTransport destructor resets the device via MMIO writes, and
    // dropping `mmio_range` destroys the mapping, so `mmio_range` must be
    // dropped last.
    // This drop-order behavior is stable.
    // See https://doc.rust-lang.org/reference/destructors.html
    //
    // TODO: The destruction order should be expressed via code rather than
    // relying on field ordering. This should be addressed when moving to
    // the upstream virtio-drivers crate.

Discussion: #1110 (comment)

This depends on #1108 that will switch to the virtio-drivers upstream crate

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