From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V77Qr-0007cF-ID for qemu-devel@nongnu.org; Wed, 07 Aug 2013 13:22:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V77Ql-0002lD-F8 for qemu-devel@nongnu.org; Wed, 07 Aug 2013 13:21:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V77Ql-0002l1-6G for qemu-devel@nongnu.org; Wed, 07 Aug 2013 13:21:51 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r77HLoPF019203 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 7 Aug 2013 13:21:50 -0400 Date: Wed, 7 Aug 2013 13:21:48 -0400 From: Jeff Cody Message-ID: <20130807172148.GA28584@localhost.localdomain> References: <20130807152904.GD2929@dhcp-200-207.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130807152904.GD2929@dhcp-200-207.str.redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 5/9] block: vhdx - break endian translation functions out List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: famz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On Wed, Aug 07, 2013 at 05:29:04PM +0200, Kevin Wolf wrote: > Am 01.08.2013 um 05:23 hat Jeff Cody geschrieben: > > This moves the endian translation functions out from the vhdx.c source, > > into a separate source file. In addition to the previously defined > > endian functions, new endian translation functions for log support are > > added as well. > > > > Signed-off-by: Jeff Cody > > > +void vhdx_log_entry_hdr_le_import(VHDXLogEntryHeader *hdr) > > +{ > > + assert(hdr != NULL); > > + > > + le32_to_cpus(&hdr->signature); > > + le32_to_cpus(&hdr->checksum); > > + le32_to_cpus(&hdr->entry_length); > > + le32_to_cpus(&hdr->tail); > > + le64_to_cpus(&hdr->sequence_number); > > + le32_to_cpus(&hdr->descriptor_count); > > + leguid_to_cpus(&hdr->log_guid); > > + le64_to_cpus(&hdr->flushed_file_offset); > > + le64_to_cpus(&hdr->last_file_offset); > > +} > > + > > +void vhdx_log_entry_hdr_le_export(VHDXLogEntryHeader *hdr) > > +{ > > + assert(hdr != NULL); > > + > > + cpu_to_le32s(&hdr->signature); > > + cpu_to_le32s(&hdr->checksum); > > + cpu_to_le32s(&hdr->entry_length); > > + cpu_to_le32s(&hdr->tail); > > + cpu_to_le64s(&hdr->sequence_number); > > + cpu_to_le32s(&hdr->descriptor_count); > > + cpu_to_le64s(&hdr->flushed_file_offset); > > + cpu_to_le64s(&hdr->last_file_offset); > > + cpu_to_leguids(&hdr->log_guid); > > +} > > Almost as critical as Stefan's comment: Can you keep the order of fields > consistent between import and export? > Absolutely! :)