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
Constraint for an IO Port address range.
Fields
MmioAddress
Constraint for a Memory Mapped IO address range.
Fields
MemAddress
Constraint for a Guest Mem address range.
Fields
LegacyIrq
Constraint for a legacy IRQ.
PciMsiIrq
Constraint for PCI MSI IRQs.
PciMsixIrq
Constraint for PCI MSIx IRQs.
GenericIrq
Constraint for generic IRQs.
KvmMemSlot
Constraint for KVM mem_slot indexes to map memory into the guest.
Implementations§
Source§impl ResourceConstraint
impl ResourceConstraint
Sourcepub fn new_pio(size: u16) -> Self
pub fn new_pio(size: u16) -> Self
Create a new PIO address constraint object with default configuration.
Sourcepub fn pio_with_constraints(
size: u16,
range: Option<(u16, u16)>,
align: u16,
) -> Self
pub fn pio_with_constraints( size: u16, range: Option<(u16, u16)>, align: u16, ) -> Self
Create a new PIO address constraint object.
Sourcepub fn new_mmio(size: u64) -> Self
pub fn new_mmio(size: u64) -> Self
Create a new MMIO address constraint object with default configuration.
Sourcepub fn mmio_with_constraints(
size: u64,
range: Option<(u64, u64)>,
align: u64,
) -> Self
pub fn mmio_with_constraints( size: u64, range: Option<(u64, u64)>, align: u64, ) -> Self
Create a new MMIO address constraint object.
Sourcepub fn new_mem(size: u64) -> Self
pub fn new_mem(size: u64) -> Self
Create a new Mem address constraint object with default configuration.
Sourcepub fn mem_with_constraints(
size: u64,
range: Option<(u64, u64)>,
align: u64,
) -> Self
pub fn mem_with_constraints( size: u64, range: Option<(u64, u64)>, align: u64, ) -> Self
Create a new Mem address constraint object.
Sourcepub fn new_legacy_irq(irq: Option<u32>) -> Self
pub fn new_legacy_irq(irq: Option<u32>) -> Self
Create a new legacy IRQ constraint object.
Allocating the pre-allocated legacy Irq irq
if specified.
Sourcepub fn new_pci_msi_irq(size: u32) -> Self
pub fn new_pci_msi_irq(size: u32) -> Self
Create a new PCI MSI IRQ constraint object.
Sourcepub fn new_pci_msix_irq(size: u32) -> Self
pub fn new_pci_msix_irq(size: u32) -> Self
Create a new PCI MSIX IRQ constraint object.
Sourcepub fn new_generic_irq(size: u32) -> Self
pub fn new_generic_irq(size: u32) -> Self
Create a new Generic IRQ constraint object.
Sourcepub fn new_kvm_mem_slot(size: u32, slot: Option<u32>) -> Self
pub fn new_kvm_mem_slot(size: u32, slot: Option<u32>) -> Self
Create a new KVM memory slot constraint object.
Allocating kvm memory slots starting from the index slot
if specified.
Trait Implementations§
Source§impl Clone for ResourceConstraint
impl Clone for ResourceConstraint
Source§fn clone(&self) -> ResourceConstraint
fn clone(&self) -> ResourceConstraint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more