Enum dbs_device::resources::ResourceConstraint
source · [−]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.
MmioAddress
Constraint for a Memory Mapped IO address range.
MemAddress
Constraint for a Guest Mem address range.
LegacyIrq
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
size: u32
Number of slots to allocate.
Constraint for KVM mem_slot indexes to map memory into the guest.
Implementations
sourceimpl 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
sourceimpl Clone for ResourceConstraint
impl Clone for ResourceConstraint
sourcefn clone(&self) -> ResourceConstraint
fn clone(&self) -> ResourceConstraint
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ResourceConstraint
impl Debug for ResourceConstraint
sourceimpl PartialEq<ResourceConstraint> for ResourceConstraint
impl PartialEq<ResourceConstraint> for ResourceConstraint
sourcefn eq(&self, other: &ResourceConstraint) -> bool
fn eq(&self, other: &ResourceConstraint) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ResourceConstraint) -> bool
fn ne(&self, other: &ResourceConstraint) -> bool
This method tests for !=
.
impl Copy for ResourceConstraint
impl StructuralPartialEq for ResourceConstraint
Auto Trait Implementations
impl RefUnwindSafe for ResourceConstraint
impl Send for ResourceConstraint
impl Sync for ResourceConstraint
impl Unpin for ResourceConstraint
impl UnwindSafe for ResourceConstraint
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more