pub enum ResourceConstraint {
    PioAddress {
        range: Option<(u16, u16)>,
        align: u16,
        size: u16,
    },
    MmioAddress {
        range: Option<(u64, u64)>,
        align: u64,
        size: u64,
    },
    MemAddress {
        range: Option<(u64, u64)>,
        align: u64,
        size: u64,
    },
    LegacyIrq {
        irq: Option<u32>,
    },
    PciMsiIrq {
        size: u32,
    },
    PciMsixIrq {
        size: u32,
    },
    GenericIrq {
        size: u32,
    },
    KvmMemSlot {
        slot: Option<u32>,
        size: u32,
    },
}
Expand description

Enumeration describing a device’s resource allocation requirements and constraints.

Variants

PioAddress

Fields

range: Option<(u16, u16)>

Allocating resource within the range [min, max] if specified.

align: u16

Alignment for the allocated address.

size: u16

Size for the allocated address range.

Constraint for an IO Port address range.

MmioAddress

Fields

range: Option<(u64, u64)>

Allocating resource within the range [min, max] if specified.

align: u64

Alignment for the allocated address.

size: u64

Size for the allocated address range.

Constraint for a Memory Mapped IO address range.

MemAddress

Fields

range: Option<(u64, u64)>

Allocating resource within the range [min, max] if specified.

align: u64

Alignment for the allocated address.

size: u64

Size for the allocated address range.

Constraint for a Guest Mem address range.

LegacyIrq

Fields

irq: Option<u32>

Reserving the pre-allocated IRQ if it’s specified.

Constraint for a legacy IRQ.

PciMsiIrq

Fields

size: u32

Number of Irqs to allocate.

Constraint for PCI MSI IRQs.

PciMsixIrq

Fields

size: u32

Number of Irqs to allocate.

Constraint for PCI MSIx IRQs.

GenericIrq

Fields

size: u32

Number of Irqs to allocate.

Constraint for generic IRQs.

KvmMemSlot

Fields

slot: Option<u32>

Allocating kvm memory slots starting from the index slot if specified.

size: u32

Number of slots to allocate.

Constraint for KVM mem_slot indexes to map memory into the guest.

Implementations

Create a new PIO address constraint object with default configuration.

Create a new PIO address constraint object.

Create a new MMIO address constraint object with default configuration.

Create a new MMIO address constraint object.

Create a new Mem address constraint object with default configuration.

Create a new Mem address constraint object.

Create a new legacy IRQ constraint object.

Allocating the pre-allocated legacy Irq irq if specified.

Create a new PCI MSI IRQ constraint object.

Create a new PCI MSIX IRQ constraint object.

Create a new Generic IRQ constraint object.

Create a new KVM memory slot constraint object.

Allocating kvm memory slots starting from the index slot if specified.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.