]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/9pfs: Add yeild support to rename coroutine
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Sat, 7 May 2011 10:39:10 +0000 (16:09 +0530)
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Mon, 8 Aug 2011 18:21:21 +0000 (23:51 +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 8fbfe7359f4ba19f3b04377539128e5965720ace..473ce53568c50663a56bc0a81e83afada8612112 100644 (file)
@@ -155,3 +155,17 @@ int v9fs_co_remove(V9fsState *s, V9fsString *path)
         });
     return err;
 }
+
+int v9fs_co_rename(V9fsState *s, V9fsString *oldpath, V9fsString *newpath)
+{
+    int err;
+
+    v9fs_co_run_in_worker(
+        {
+            err = s->ops->rename(&s->ctx, oldpath->data, newpath->data);
+            if (err < 0) {
+                err = -errno;
+            }
+        });
+    return err;
+}
index 60795c48fa80e28de815e99fbcfeb95b96338a57..11272d3357aa7553b5b8dbefb4462c1663992c92 100644 (file)
@@ -75,4 +75,5 @@ extern int v9fs_co_mknod(V9fsState *, V9fsString *, uid_t,
                          gid_t, dev_t, mode_t);
 extern int v9fs_co_mkdir(V9fsState *, char *, mode_t, uid_t, gid_t);
 extern int v9fs_co_remove(V9fsState *, V9fsString *);
+extern int v9fs_co_rename(V9fsState *, V9fsString *, V9fsString *);
 #endif