]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
hw/9pfs: Add yield support for pwritev coroutine
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Sun, 8 May 2011 07:06:59 +0000 (12:36 +0530)
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Mon, 22 Aug 2011 04:14:37 +0000 (09:44 +0530)
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs/cofile.c
hw/9pfs/virtio-9p-coth.h

index 52eec2a662a8b4e36c10b7bf05397e8562e3f175..e0d032dc15a7e58f1596a7fda9f723e07205d533 100644 (file)
@@ -127,3 +127,20 @@ int v9fs_co_link(V9fsState *s, V9fsString *oldpath, V9fsString *newpath)
         });
     return err;
 }
+
+int v9fs_co_pwritev(V9fsState *s, V9fsFidState *fidp,
+                    struct iovec *iov, int iovcnt, int64_t offset)
+{
+    int fd;
+    int err;
+
+    fd = fidp->fs.fd;
+    v9fs_co_run_in_worker(
+        {
+            err = s->ops->pwritev(&s->ctx, fd, iov, iovcnt, offset);
+            if (err < 0) {
+                err = -errno;
+            }
+        });
+    return err;
+}
index 17ffd76f367feef7dee75054747030715009b9c0..fa408f876ee7b79e1345dfe3f201a081de72308b 100644 (file)
@@ -89,4 +89,6 @@ extern int v9fs_co_fsync(V9fsState *, V9fsFidState *, int);
 extern int v9fs_co_symlink(V9fsState *, V9fsFidState *, const char *,
                            const char *, gid_t);
 extern int v9fs_co_link(V9fsState *, V9fsString *, V9fsString *);
+extern int v9fs_co_pwritev(V9fsState *, V9fsFidState *,
+                           struct iovec *, int, int64_t);
 #endif