From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38958 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbwYY-0001eZ-Ny for qemu-devel@nongnu.org; Sun, 09 Jan 2011 09:47:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PbwYX-0005iP-6W for qemu-devel@nongnu.org; Sun, 09 Jan 2011 09:47:42 -0500 Received: from mail-pw0-f45.google.com ([209.85.160.45]:45947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PbwYX-0005iC-1N for qemu-devel@nongnu.org; Sun, 09 Jan 2011 09:47:41 -0500 Received: by pwj6 with SMTP id 6so3235784pwj.4 for ; Sun, 09 Jan 2011 06:47:40 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <285da2b9a83353703d07e141fdb447e82944146c.1294433287.git.riku.voipio@nokia.com> References: <285da2b9a83353703d07e141fdb447e82944146c.1294433287.git.riku.voipio@nokia.com> From: Blue Swirl Date: Sun, 9 Jan 2011 14:47:19 +0000 Message-ID: Subject: Re: [Qemu-devel] [PATCH 3/7] linux-user: Implement FS_IOC_FIEMAP ioctl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Riku Voipio Cc: Peter Maydell , qemu-devel@nongnu.org On Fri, Jan 7, 2011 at 8:52 PM, Riku Voipio wrote: > From: Peter Maydell > > Implement the FS_IOC_FIEMAP ioctl using the new support for > custom handling of ioctls; this is needed because the struct > that is passed includes a variable-length array. > > Signed-off-by: Peter Maydell > Signed-off-by: Riku Voipio > --- > =C2=A0linux-user/ioctls.h =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=A04 ++ > =C2=A0linux-user/syscall.c =C2=A0 =C2=A0 =C2=A0 | =C2=A0 88 +++++++++++++= +++++++++++++++++++++++++++++++ > =C2=A0linux-user/syscall_defs.h =C2=A0| =C2=A0 =C2=A01 + > =C2=A0linux-user/syscall_types.h | =C2=A0 16 ++++++++ > =C2=A04 files changed, 109 insertions(+), 0 deletions(-) > > diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h > index 769e1bc..538e257 100644 > --- a/linux-user/ioctls.h > +++ b/linux-user/ioctls.h > @@ -76,6 +76,10 @@ > =C2=A0#ifdef FIGETBSZ > =C2=A0 =C2=A0 =C2=A0IOCTL(FIGETBSZ, IOC_R, MK_PTR(TYPE_LONG)) > =C2=A0#endif > +#ifdef FS_IOC_FIEMAP > + =C2=A0 =C2=A0 IOCTL_SPECIAL(FS_IOC_FIEMAP, IOC_W | IOC_R, do_ioctl_fs_i= oc_fiemap, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 MK_PTR(M= K_STRUCT(STRUCT_fiemap))) > +#endif > > =C2=A0 IOCTL(SIOCATMARK, 0, TYPE_NULL) > =C2=A0 IOCTL(SIOCADDRT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtentry))) > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > index 970efe3..f10e17a 100644 > --- a/linux-user/syscall.c > +++ b/linux-user/syscall.c > @@ -83,6 +83,7 @@ int __clone2(int (*fn)(void *), void *child_stack_base, > =C2=A0#include > =C2=A0#include > =C2=A0#include > +#include This fails if the file doesn't exist: CC i386-linux-user/syscall.o /src/qemu/linux-user/syscall.c:86:26: error: linux/fiemap.h: No such file or directory /src/qemu/linux-user/syscall.c: In function 'do_ioctl_fs_ioc_fiemap': /src/qemu/linux-user/syscall.c:3025: error: dereferencing pointer to incomplete type /src/qemu/linux-user/syscall.c:3025: error: invalid application of 'sizeof' to incomplete type 'struct fiemap' /src/qemu/linux-user/syscall.c:3025: error: invalid application of 'sizeof' to incomplete type 'struct fiemap_extent' cc1: warnings being treated as errors /src/qemu/linux-user/syscall.c:3025: error: division by zero /src/qemu/linux-user/syscall.c:3029: error: dereferencing pointer to incomplete type /src/qemu/linux-user/syscall.c:3030: error: invalid application of 'sizeof' to incomplete type 'struct fiemap_extent' /src/qemu/linux-user/syscall.c:3030: error: dereferencing pointer to incomplete type /src/qemu/linux-user/syscall.c:3040: error: invalid application of 'sizeof' to incomplete type 'struct fiemap' /src/qemu/linux-user/syscall.c:3049: error: dereferencing pointer to incomplete type /src/qemu/linux-user/syscall.c:3050: error: dereferencing pointer to incomplete type /src/qemu/linux-user/syscall.c:3058: error: dereferencing pointer to incomplete type /src/qemu/linux-user/syscall.c:3061: error: dereferencing pointer to incomplete type /src/qemu/linux-user/syscall.c:3062: error: dereferencing pointer to incomplete type The fix is to introduce a feature check in configure.