From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RG0dT-0006Fz-OV for qemu-devel@nongnu.org; Mon, 17 Oct 2011 23:46:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RG0dQ-0007P2-Ue for qemu-devel@nongnu.org; Mon, 17 Oct 2011 23:46:39 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:54918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RG0dQ-0007Od-CS for qemu-devel@nongnu.org; Mon, 17 Oct 2011 23:46:36 -0400 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp02.au.ibm.com (8.14.4/8.13.1) with ESMTP id p9I3dnDm014514 for ; Tue, 18 Oct 2011 14:39:49 +1100 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p9I3kSju2371708 for ; Tue, 18 Oct 2011 14:46:31 +1100 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p9I3kSJU016989 for ; Tue, 18 Oct 2011 14:46:28 +1100 Date: Tue, 18 Oct 2011 14:46:25 +1100 From: David Gibson Message-ID: <20111018034625.GC6655@truffala.fritz.box> References: <1318242628-18729-1-git-send-email-wuzhy@linux.vnet.ibm.com> <87r52kn6t2.fsf@linux.vnet.ibm.com> <87obxon65g.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87obxon65g.fsf@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH] virtio-9p: fix QEMU build break List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Aneesh Kumar K.V" Cc: stefanha@linux.vnet.ibm.com, kvm@vger.kernel.org, jvrao@us.ibm.com, qemu-devel@nongnu.org, zwu.kernel@gmail.com, Zhi Yong Wu On Mon, Oct 10, 2011 at 10:19:31PM +0530, Aneesh Kumar K.V wrote: > On Mon, 10 Oct 2011 22:05:21 +0530, "Aneesh Kumar K.V" wrote: > > On Mon, 10 Oct 2011 18:30:28 +0800, Zhi Yong Wu wrote: > > > qemu build break due to the redefinition of struct file_handle. My qemu.git/HEAD is 8acbc9b21d757a6be4f8492e547b8159703a0547 > > > > > > Below is the log: > > > [root@f15 qemu]# make > > > CC qapi-generated/qga-qapi-types.o > > > LINK qemu-ga > > > CC libhw64/9pfs/virtio-9p-handle.o > > > /home/zwu/work/virt/qemu/hw/9pfs/virtio-9p-handle.c:31:8: error: redefinition of "struct file_handle" > > > /usr/include/bits/fcntl.h:254:8: note: originally defined here > > > make[1]: *** [9pfs/virtio-9p-handle.o] Error 1 > > > make: *** [subdir-libhw64] Error 2 > > > > > > [root@f15 qemu]# rpm -qf /usr/include/bits/fcntl.h > > > glibc-headers-2.13.90-9.x86_64 > > > > > > > Is this a backported glibc ? On my ubuntu system glibc 2.13 doesn't > > provide struct file_handle. I also checked glib repo at > > http://repo.or.cz/w/glibc.git. The commit introducing struct file_handle > > is > > > > $ git describe --contains 158648c0bdda281e252a27c0200dd0ea6f4e0215 > > glibc-2.14~200 > > > > > > How about the below patch. This means that handle driver will only work > with latest glibc. Even if i have latest kernel, with an older glibc > handle fs driver backed will be disabled. This looks like the right approach to me, but at least with my compiler / libc combinations, the test program isn't quite right: because the file_handle pointer is never dereferenced, gcc doesn't complain even if it is undefined. > diff --git a/configure b/configure > index 24b8df4..0216c53 100755 > --- a/configure > +++ b/configure > @@ -2551,6 +2551,18 @@ EOF > fi > > ########################################## > +# check if we have open_by_handle_at > + > +open_by_hande_at=no > +cat > $TMPC << EOF > +#include > +int main(void) { struct file_handle *fh; open_by_handle_at(0, fh, 0); } Instead, try this: int main(void) { struct file_handle fh; open_by_handle_at(0, &fh, 0); } I'd really like to see a patch along these lines merged, so I don't have to keep hacking it up manually just to get qemu to compile. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson