From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RT68Q-0006Cy-Ng for qemu-devel@nongnu.org; Wed, 23 Nov 2011 01:16:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RT68P-0005Se-IX for qemu-devel@nongnu.org; Wed, 23 Nov 2011 01:16:42 -0500 Received: from e37.co.us.ibm.com ([32.97.110.158]:44053) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RT68P-0005SJ-Ay for qemu-devel@nongnu.org; Wed, 23 Nov 2011 01:16:41 -0500 Received: from /spool/local by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 22 Nov 2011 23:16:39 -0700 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pAN6GaVE082618 for ; Tue, 22 Nov 2011 23:16:36 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pAN6GZk6014745 for ; Tue, 22 Nov 2011 23:16:35 -0700 From: "Aneesh Kumar K.V" In-Reply-To: <1321864151-13988-1-git-send-email-pbonzini@redhat.com> References: <1321864151-13988-1-git-send-email-pbonzini@redhat.com> Date: Wed, 23 Nov 2011 11:46:27 +0530 Message-ID: <8762ibl5xg.fsf@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 1.0] 9pfs: improve portability to older systems List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org On Mon, 21 Nov 2011 09:29:11 +0100, Paolo Bonzini wrote: > Small requirements on "new" features have percolated to virtio-9p-local.c. > In particular, the utimensat wrapper actually only supports dirfd = AT_FDCWD > and flags = AT_SYMLINK_NOFOLLOW in the fallback code. Remove the arguments > so that virtio-9p-local.c will not use AT_* constants. > > At the same time, fail local_ioc_getversion if the ioctl is not supported > by the host. > > Signed-off-by: Paolo Bonzini > --- > hw/9pfs/virtio-9p-local.c | 7 +++++-- > oslib-posix.c | 5 ++--- > qemu-os-posix.h | 3 +-- > 3 files changed, 8 insertions(+), 7 deletions(-) > > diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c > index 7f1c089..cbd07e8 100644 > --- a/hw/9pfs/virtio-9p-local.c > +++ b/hw/9pfs/virtio-9p-local.c > @@ -583,8 +583,7 @@ static int local_utimensat(FsContext *s, V9fsPath *fs_path, > char buffer[PATH_MAX]; > char *path = fs_path->data; > > - return qemu_utimensat(AT_FDCWD, rpath(s, path, buffer), buf, > - AT_SYMLINK_NOFOLLOW); > + return qemu_utimens(rpath(s, path, buffer), buf); > } > > static int local_remove(FsContext *ctx, const char *path) > @@ -694,6 +693,7 @@ static int local_ioc_getversion(FsContext *ctx, V9fsPath *path, > mode_t st_mode, uint64_t *st_gen) > { > int err; > +#ifdef FS_IOC_GETVERSION > V9fsFidOpenState fid_open; > > /* > @@ -709,6 +709,9 @@ static int local_ioc_getversion(FsContext *ctx, V9fsPath *path, > } > err = ioctl(fid_open.fd, FS_IOC_GETVERSION, st_gen); > local_close(ctx, &fid_open); > +#else > + err = -ENOTTY; > +#endif > return err; I guess we can also make sure we don't call local_ioc_getversion at all. diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c index 0da3bdd..1c349af 100644 --- a/hw/9pfs/virtio-9p-local.c +++ b/hw/9pfs/virtio-9p-local.c @@ -714,10 +714,14 @@ static int local_ioc_getversion(FsContext *ctx, V9fsPath *path, static int local_init(FsContext *ctx) { - int err; + int err = 0; struct statfs stbuf; ctx->export_flags |= V9FS_PATHNAME_FSCONTEXT; +#ifdef FS_IOC_GETVERSION + /* + * use ioc_getversion only if the iocl is definied + */ err = statfs(ctx->fs_root, &stbuf); if (!err) { switch (stbuf.f_type) { @@ -729,6 +733,7 @@ static int local_init(FsContext *ctx) break; } } +#endif return err; } We would also require same changes for virtio-9p-handle.c right ? -aneesh