aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-11-23 11:46:27 +0530
committerAnthony Liguori <aliguori@us.ibm.com>2011-11-28 16:19:57 -0600
commit2507718baf311ea78156c6777d38410a9f89ce89 (patch)
tree69d7f75e8be40647eacec85a19e15493d9669bbf
parent51711aee8cb0b17d53872cc06fe73af50c7d9ebd (diff)
downloadqemu-arm-2507718baf311ea78156c6777d38410a9f89ce89.tar.gz
9pfs: improve portability to older systems
I guess we can also make sure we don't call local_ioc_getversion at all. Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--hw/9pfs/virtio-9p-local.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c
index cbd07e8659..99ef0cd333 100644
--- a/hw/9pfs/virtio-9p-local.c
+++ b/hw/9pfs/virtio-9p-local.c
@@ -717,10 +717,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) {
@@ -732,6 +736,7 @@ static int local_init(FsContext *ctx)
break;
}
}
+#endif
return err;
}