From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bY1tk-0007ab-Ps for qemu-devel@nongnu.org; Thu, 11 Aug 2016 22:08:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bY1ti-00012H-V9 for qemu-devel@nongnu.org; Thu, 11 Aug 2016 22:08:35 -0400 Date: Fri, 12 Aug 2016 10:01:26 +0800 From: Fam Zheng Message-ID: <20160812020126.GC2759@al.usersys.redhat.com> References: <1470891017-5800-1-git-send-email-famz@redhat.com> <1470891017-5800-2-git-send-email-famz@redhat.com> <2c193764-6c6a-25fe-f59d-9a5fd9fa838d@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2c193764-6c6a-25fe-f59d-9a5fd9fa838d@twiddle.net> Subject: Re: [Qemu-devel] [PATCH v4 1/9] util: Add UUID API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, kwolf@redhat.com, qemu-block@nongnu.org, sw@weilnetz.de, jcody@redhat.com, mdroth@linux.vnet.ibm.com, armbru@redhat.com, pbonzini@redhat.com, mreitz@redhat.com On Thu, 08/11 23:21, Richard Henderson wrote: > On 08/11/2016 05:50 AM, Fam Zheng wrote: > >+void qemu_uuid_bswap(QemuUUID *uuid) > >+{ > >+ bswap32s((uint32_t *)&uuid->data[0]); > >+ bswap16s((uint16_t *)&uuid->data[4]); > >+ bswap16s((uint16_t *)&uuid->data[6]); > >+} > > You have alignment problems here too. Perhaps you really did want > to add uint32_t (and uint16_t?) as union members to QemuUUID. But that may not be enough for embedded QemuUUID in a packed structure, such as in block/vdi.c. So I'll also add an assertion here. Fam