On Thu, Aug 01, 2013 at 05:00:05PM +0200, Stefan Hajnoczi wrote: > On Wed, Jul 31, 2013 at 11:23:49PM -0400, Jeff Cody wrote: > > @@ -318,6 +323,18 @@ typedef struct VHDXMetadataEntries { > > uint16_t present; > > } VHDXMetadataEntries; > > > > +typedef struct VHDXLogEntries { > > + uint64_t offset; > > + uint64_t length; > > + uint32_t head; > > + uint32_t tail; > > +} VHDXLogEntries; > > + > > +typedef struct VHDXLogEntryInfo { > > + uint64_t sector_start; > > + uint32_t desc_count; > > +} VHDXLogEntryInfo; > > An array of VHDXLogEntryInfo structs would be affected by alignment on > x86_64. &a[1] != (void*)a + sizeof(VHDXLogEntryInfo). > > IMO all on-disk structs should be QEMU_PACKED for safety.
Neither of the two structs above reflect on-disk structs (actually VHDXLogEntryInfo is currently unused, so I should drop it from this patch). I should mention this in the commit message, since the patch context isn't enough to show it, but the structs introduced in this patch are below a comment demarcation line that calls out an end to the on-disk structs: /* ----- END VHDX SPECIFICATION STRUCTURES ---- */