On Mon, Jun 29, 2015 at 03:35:59PM +0200, Gerd Hoffmann wrote:
Hi,
+typedef struct virtio_pci_common_cfg {
- /* About the whole device. */
- u32 device_feature_select; /* read-write */
If I understand these structs correctly, they don't reside in memory, but instead represent an interface layout and are used with offsetof() and sizeof().
Correct.
If so, I think they should be marked with PACKED.
They are carefully ordered and padded so that adding PACKED should not change anything. The linux kernel has them without PACKED too.
Okay - it's up to you. It helps a little with documentation - but moving to "std/" would acomplish the same thing.
-Kevin