summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2023-10-31 12:02:06 -0400
committerMichael S. Tsirkin <mst@redhat.com>2023-11-01 09:31:16 -0400
commit3503895788d402d6a3814085ed582c364ec3e903 (patch)
tree7924cd651500b6a72ceca421d9fb2f025e43885e /include/uapi/linux
parent86f6c224c97911b4392cb7b402e6a4ed323a449e (diff)
downloadlinux-stable-3503895788d402d6a3814085ed582c364ec3e903.tar.gz
linux-stable-3503895788d402d6a3814085ed582c364ec3e903.tar.bz2
linux-stable-3503895788d402d6a3814085ed582c364ec3e903.zip
virtio_pci: move structure to a header
These are guest/host interfaces, so they belong in the header where e.g. qemu will know to find them. Note: we added a new structure as opposed to extending existing one because someone might be relying on the size of the existing structure staying unchanged. Add a warning to avoid using sizeof. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/virtio_pci.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
index f703afc7ad31..44f4dd2add18 100644
--- a/include/uapi/linux/virtio_pci.h
+++ b/include/uapi/linux/virtio_pci.h
@@ -166,6 +166,17 @@ struct virtio_pci_common_cfg {
__le32 queue_used_hi; /* read-write */
};
+/*
+ * Warning: do not use sizeof on this: use offsetofend for
+ * specific fields you need.
+ */
+struct virtio_pci_modern_common_cfg {
+ struct virtio_pci_common_cfg cfg;
+
+ __le16 queue_notify_data; /* read-write */
+ __le16 queue_reset; /* read-write */
+};
+
/* Fields in VIRTIO_PCI_CAP_PCI_CFG: */
struct virtio_pci_cfg_cap {
struct virtio_pci_cap cap;