mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
VirtioPciCfgCap::new built its inner header via VirtioPciCap::new, which sized cap_len from the bare virtio_pci_cap layout, yielding 16. The emitted capability is VirtioPciCfgCap, which appends a four byte pci_cfg_data window, so the correct value is 20. The virtio 1.2 specification defines this cap as virtio_pci_cap followed by pci_cfg_data[4] and requires cap_len to cover the whole structure. Build the header inline so cap_len reflects the actual emitted size, matching VirtioPciNotifyCap and VirtioPciCap64. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>