[Virtio-fs] [PATCH 1/2] virito: Add 'id' field to capability header

Dr. David Alan Gilbert (git) dgilbert at redhat.com
Thu Jul 18 15:13:54 UTC 2019


From: "Dr. David Alan Gilbert" <dgilbert at redhat.com>

For the shm capability we need to have multiple capabilities of the same
type, with different uses.  For this we need an 'id' field to
differentiate them.  Place this field in one of the spare bytes
of the header.

Suggested-by: Michael S. Tsirkin <mst at redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert at redhat.com>
---
 include/uapi/linux/virtio_pci.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
index 31841a60a4ad..961bb6e6315c 100644
--- a/include/uapi/linux/virtio_pci.h
+++ b/include/uapi/linux/virtio_pci.h
@@ -123,7 +123,8 @@ struct virtio_pci_cap {
 	__u8 cap_len;		/* Generic PCI field: capability length */
 	__u8 cfg_type;		/* Identifies the structure. */
 	__u8 bar;		/* Where to find it. */
-	__u8 padding[3];	/* Pad to full dword. */
+	__u8 id;		/* Multiple capabilities of the same type */
+	__u8 padding[2];	/* Pad to full dword. */
 	__le32 offset;		/* Offset within bar. */
 	__le32 length;		/* Length of the structure, in bytes. */
 };
-- 
2.21.0




More information about the Virtio-fs mailing list