STRUCT VIRTIO_DEVICE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 the VIRTIO_CONFIG_S_FAILED bit (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 β€” protects vqs. 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 by debugfs 🫧

πŸ‘€ 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