From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4v9u-0004fh-2z for qemu-devel@nongnu.org; Thu, 01 Aug 2013 11:51:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V4v9k-0001VQ-UX for qemu-devel@nongnu.org; Thu, 01 Aug 2013 11:51:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39056) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4v9k-0001VD-NN for qemu-devel@nongnu.org; Thu, 01 Aug 2013 11:51:12 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r71FpBK2011479 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 1 Aug 2013 11:51:11 -0400 Date: Thu, 1 Aug 2013 11:51:08 -0400 From: Jeff Cody Message-ID: <20130801155108.GK19714@localhost.localdomain> References: <9e47d3ea77357b438ce2164f6e226d216553c58e.1375325971.git.jcody@redhat.com> <20130801150005.GE2387@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130801150005.GE2387@stefanha-thinkpad.redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 4/9] block: vhdx - log support struct and defines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org 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 ---- */