]> git.proxmox.com Git - qemu.git/commitdiff
hw/9pfs: Add yield support to statfs coroutine
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Wed, 18 May 2011 23:03:49 +0000 (16:03 -0700)
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Mon, 8 Aug 2011 18:12:58 +0000 (23:42 +0530)
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs/cofs.c
hw/9pfs/virtio-9p-coth.h

index 6bb8b47da3399a36e9175f15f31ed8491438fbf1..4138e4d02a5eadc701f2cdcf3ba1b2593f382aaf 100644 (file)
@@ -42,3 +42,17 @@ int v9fs_co_readlink(V9fsState *s, V9fsString *path, V9fsString *buf)
     }
     return err;
 }
+
+int v9fs_co_statfs(V9fsState *s, V9fsString *path, struct statfs *stbuf)
+{
+    int err;
+
+    v9fs_co_run_in_worker(
+        {
+            err = s->ops->statfs(&s->ctx, path->data, stbuf);
+            if (err < 0) {
+                err = -errno;
+            }
+        });
+    return err;
+}
index 9aa5953a0e29d6b208de8f68afaa05b1cc6d7e97..5d9dc0f6cc1eddd77f4761fe44810bdb6303a6db 100644 (file)
@@ -62,4 +62,5 @@ extern int v9fs_co_readdir(V9fsState *, V9fsFidState *,
 extern off_t v9fs_co_telldir(V9fsState *, V9fsFidState *);
 extern void v9fs_co_seekdir(V9fsState *, V9fsFidState *, off_t);
 extern void v9fs_co_rewinddir(V9fsState *, V9fsFidState *);
+extern int v9fs_co_statfs(V9fsState *, V9fsString *, struct statfs *);
 #endif