From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KQ6I3-0007Dq-Fw for qemu-devel@nongnu.org; Mon, 04 Aug 2008 16:04:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KQ6I1-0007Cr-S2 for qemu-devel@nongnu.org; Mon, 04 Aug 2008 16:04:22 -0400 Received: from [199.232.76.173] (port=48849 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KQ6I1-0007Ci-M2 for qemu-devel@nongnu.org; Mon, 04 Aug 2008 16:04:21 -0400 Received: from mail.codesourcery.com ([65.74.133.4]:52450) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KQ6I0-0006Ef-Vt for qemu-devel@nongnu.org; Mon, 04 Aug 2008 16:04:21 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH 5/7] xen: add block device backend driver. Date: Mon, 4 Aug 2008 21:04:15 +0100 References: <1217865045-10722-1-git-send-email-kraxel@redhat.com> <48975D9A.7070109@redhat.com> In-Reply-To: <48975D9A.7070109@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200808042104.16383.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , xen-devel@lists.xensource.com, Gerd Hoffmann On Monday 04 August 2008, Gerd Hoffmann wrote: > Blue Swirl wrote: > > On 8/4/08, Gerd Hoffmann wrote: > >> +/* i386 protocol version */ > >> +#pragma pack(push, 4) > > > > What's wrong with __attribute__(__aligned__)? > > That one is tricky because we must be binary compatible with xen. And > the block driver protocol has a small design flaw: It has a 64bit value > which is not aligned on a 64bit border. This leads to different struct > layouts on i386 and x86_64 due to different alignment rules. Unless you > force them into something else, like we do in that header file to deal > with it. Which is needed to run 32bit guests on 64bit hosts. qemu should be host independent. You need to use packed structures with appropriate padding. Paul