]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
9pfs: improve portability to older systems
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Wed, 23 Nov 2011 06:16:27 +0000 (11:46 +0530)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 28 Nov 2011 22:19:57 +0000 (16:19 -0600)
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>
hw/9pfs/virtio-9p-local.c

index cbd07e8659aa25faf1e2224301993322188bcf21..99ef0cd33346ff86fbfd2543d2f46dd0e5ccd462 100644 (file)
@@ -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;
 }