#[repr(C)]pub struct DeviceClass {Show 14 fields
pub parent_class: ObjectClass,
pub categories: [c_ulong; 1],
pub fw_name: *const c_char,
pub desc: *const c_char,
pub props_: *const Property,
pub props_count_: u16,
pub user_creatable: bool,
pub hotpluggable: bool,
pub legacy_reset: DeviceReset,
pub realize: DeviceRealize,
pub unrealize: DeviceUnrealize,
pub sync_config: DeviceSyncConfig,
pub vmsd: *const VMStateDescription,
pub bus_type: *const c_char,
}Expand description
struct DeviceClass - The base class for all devices. @props: Properties accessing state fields. @realize: Callback function invoked when the #DeviceState:realized property is changed to %true. @unrealize: Callback function invoked when the #DeviceState:realized property is changed to %false. @sync_config: Callback function invoked when QMP command device-sync-config is called. Should synchronize device configuration from host to guest part and notify the guest about the change. @hotpluggable: indicates if #DeviceClass is hotpluggable, available as readonly “hotpluggable” property of #DeviceState instance
Fields§
§parent_class: ObjectClass§categories: [c_ulong; 1]@categories: device categories device belongs to
fw_name: *const c_char@fw_name: name used to identify device to firmware interfaces
desc: *const c_char@desc: human readable description of device
props_: *const Property@props_: properties associated with device, should only be assigned by using device_class_set_props(). The underscore ensures a compile-time error if someone attempts to assign dc->props directly.
props_count_: u16@props_count_: number of elements in @props_; should only be assigned by using device_class_set_props().
user_creatable: bool@user_creatable: Can user instantiate with -device / device_add?
All devices should support instantiation with device_add, and this flag should not exist. But we’re not there, yet. Some devices fail to instantiate with cryptic error messages. Others instantiate, but don’t work. Exposing users to such behavior would be cruel; clearing this flag will protect them. It should never be cleared without a comment explaining why it is cleared.
TODO remove once we’re there
hotpluggable: bool§legacy_reset: DeviceReset@legacy_reset: deprecated device reset method pointer
Modern code should use the ResettableClass interface to implement a multi-phase reset.
TODO: remove once every reset callback is unused
realize: DeviceRealize§unrealize: DeviceUnrealize§sync_config: DeviceSyncConfig§vmsd: *const VMStateDescription@vmsd: device state serialisation description for migration/save/restore
bus_type: *const c_char@bus_type: bus type private: to qdev / bus.
Trait Implementations§
Source§impl Clone for DeviceClass
impl Clone for DeviceClass
Source§fn clone(&self) -> DeviceClass
fn clone(&self) -> DeviceClass
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more