STRUCT ACRN_VDEV(9)
π struct acrn_vdev (9) β the Kernel API Manual, bestie edition
okay so you're here for struct acrn_vdev, and honestly? it's giving "backstage pass to the hypervisor." this is a Kernel API Manual page, so grab a snack and let's get into it π
β¨ NAME β¨
struct acrn_vdev β literally just the info you need for creating or destroying a virtual device. that's the whole vibe. π
π¦ SYNOPSIS π¦
here's the struct, copy-pasted exactly because i would never mess with your code:
struct acrn_vdev {
union {
__u64 value;
struct {
__le16 vendor;
__le16 device;
__le32 legacy_id;
} fields;
} id;
__u64 slot;
__u32 io_addr[ACRN_PCI_NUM_BARS];
__u32 io_size[ACRN_PCI_NUM_BARS];
__u8 args[128];
};
no cap, she's compact. let's break down every single member π
πΈ Members πΈ
idβ a union holding the identifier of the virtual device. it's the "who dis" field πid.valueβ the raw data of the identifier. just the bits, unfiltered.id.fields.vendorβ vendor id of the virtual PCI device π·οΈid.fields.deviceβ device id of the virtual PCI device β¨id.fields.legacy_idβ the ID of the virtual device if it's not a PCI device. legacy icon behavior π§slotβ virtual Bus/Device/Function of the virtual device. that's BDF, iykyk.io_sizeβ IO resource size of the virtual device. how much room she needs πargsβ arguments for the virtual device creation. the little 128-byte goodie bag of creation params π
side note: you'll also clock io_addr[ACRN_PCI_NUM_BARS] sitting right there in the struct β the page doesn't say anything about it, so neither will i. no invented lore on my watch π
π₯ Description π₯
okay so the whole point: the created virtual device can be a PCI device or a legacy device (like, say, a virtual UART controller), and it's emulated by the hypervisor. main character energy, the hypervisor does all the work π
this structure gets passed to the hypervisor directly. no middleman, no filter, fr fr. so treat what you put in there with the respect it deserves π
π SEE ALSO π
go touch some other structs, bestie:
- Kernel file
./include/uapi/linux/acrn.hβ that's where these live π«Ά struct acrn_mmio_request(9)struct acrn_pio_request(9)struct acrn_pci_request(9)struct acrn_io_request(9)struct acrn_ioreq_notify(9)struct acrn_vm_creation(9)struct acrn_gp_regs(9)struct acrn_descriptor_ptr(9)struct acrn_regs(9)struct acrn_vcpu_regs(9)struct acrn_vm_memmap(9)struct acrn_ptdev_irq(9)struct acrn_pcidev(9)struct acrn_mmio_dev_res(9)struct acrn_mmiodev(9)struct acrn_msi_entry(9)struct acrn_cstate_data(9)struct acrn_pstate_data(9)struct acrn_ioeventfd(9)struct acrn_irqfd(9)
like, the entire acrn friend group. go say hi π
and that's the page, bestie π she lives in ./include/uapi/linux, dated October 2026 β that's the source and the date, so you can cite me. stay hydrated, keep your structs aligned, and slay your ioctls β¨π
π¦ 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