STRUCT VIRTIO_DEVICE(9)
π NAME π
okay bestie, welcome to the struct virtio_device(9) page from the Kernel API Manual β it's literally the representation of a device using virtio. that's the whole vibe. periodt. β¨
β¨ SYNOPSIS β¨
here's the struct in all its main-character glory, no edits, no cap:
struct virtio_device {
int index;
bool failed;
bool config_core_enabled;
bool config_driver_disabled;
bool config_change_pending;
spinlock_t config_lock;
spinlock_t vqs_list_lock;
struct device dev;
struct virtio_device_id id;
const struct virtio_config_ops *config;
const struct vringh_config_ops *vringh_config;
const struct virtio_map_ops *map;
struct list_head vqs;
union {
u64 features;
u64 features_array[VIRTIO_FEATURES_U64S];
};
void *priv;
union virtio_map vmap;
#ifdef CONFIG_VIRTIO_DEBUG;
struct dentry *debugfs_dir;
u64 debugfs_filter_features[VIRTIO_FEATURES_U64S];
#endif;
};
πΈ Members πΈ
indexβ its unique position on the virtio bus. like the bus's lil coordinate, bestie πfailedβ saved value for theVIRTIO_CONFIG_S_FAILEDbit (for restore). it's giving "remember this for later" energy πconfig_core_enabledβ configuration change reporting enabled by core. core said "reporting on," slay β¨config_driver_disabledβ configuration change reporting disabled by a driver. driver said "actually, off," okay then πconfig_change_pendingβ configuration change reported while disabled. it's waiting in the group chat, lowkey π«Άconfig_lockβ protects configuration change reporting. the bodyguard for the config-change gossip πvqs_list_lockβ protectsvqs. no cap, that's its whole job π‘οΈdevβ underlying device. the device underneath, literally πidβ the device type identification (used to match it with a driver). matchmaker energy, fr fr πconfigβ the configuration ops for this device. the config to-do list π§vringh_configβ configuration ops for host vrings. host-vring config business πmapβ the map operations for mapping virtio device memory. maps, but make it virtio memory πΊοΈvqsβ the list of virtqueues for this device. the virtqueue lineup π{unnamed_union}β anonymous. yes, that's the whole note, and honestly? iconic πfeaturesβ the 64 lower features supported by both driver and device. the lower 64, matching on both sides π€features_arrayβ the full features space supported by both driver and device. the full feature space, no crumbs πprivβ private pointer for the driver's use. driver's lil private stash πvmapβ the map container with transport- or device-specific metadata. transport- or device-specific metadata lives here πdebugfs_dirβ debugfs directory entry. a debugfs directory entry, periodt πdebugfs_filter_featuresβ features to be filtered set by debugfs. the features-to-be-filtered set bydebugfsπ«§
π SEE ALSO π
Kernel file ./include/linux/virtio.h, plus struct virtqueue(9) and struct virtio_driver(9) β go read those if you want the full lore. iykyk π¦
later bestie β this struct virtio_device(9) page came from ./include/linux, October 2026, and it's slaying into the sunset π
πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms