From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KQ65T-0005GB-Hg for qemu-devel@nongnu.org; Mon, 04 Aug 2008 15:51:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KQ65S-0005E8-Ov for qemu-devel@nongnu.org; Mon, 04 Aug 2008 15:51:22 -0400 Received: from [199.232.76.173] (port=53887 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KQ65S-0005Dt-Du for qemu-devel@nongnu.org; Mon, 04 Aug 2008 15:51:22 -0400 Received: from mx1.redhat.com ([66.187.233.31]:60877) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KQ65S-0003bT-1P for qemu-devel@nongnu.org; Mon, 04 Aug 2008 15:51:22 -0400 Message-ID: <48975D9A.7070109@redhat.com> Date: Mon, 04 Aug 2008 21:50:50 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 5/7] xen: add block device backend driver. References: <1217865045-10722-1-git-send-email-kraxel@redhat.com> <1217865045-10722-6-git-send-email-kraxel@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: xen-devel@lists.xensource.com, qemu-devel@nongnu.org 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. >> + RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&blkdev->rings.common, send_notify); > > EUGLY_LONG_NAME_WITH_ALL_CAPS Xen API, no way around that, sorry. >> + mode = O_RDONLY; >> + qflags = BDRV_O_RDONLY; >> + info |= VDISK_READONLY | VDISK_REMOVABLE | VDISK_CDROM; > > Does this mean that all read-only disks are assumed to be CDROMs or > that all removable disks are read-only? I'll double-check, but I think there is no media=[disk|cdrom] indicator in xenstore. So that was the best I could come up with ... > Why IF_XEN? I've seen you've noticed meanwhile in patch #7 ;) > Why different protocols for i386 and x86_64? See above. > Would I need to add > Sparc32 and Sparc64 versions some day? Not sure whenever the same 32/64bit ABI issue exists on sparc. If so, the code handling this on x86 should work for sparc too. cheers, Gerd -- http://kraxel.fedorapeople.org/xenner/