aboutsummaryrefslogtreecommitdiff
path: root/hw/9pfs/cofs.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-05-07 16:09:10 +0530
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2011-08-08 23:51:21 +0530
commit2a487e05def38b73ae25db61f62fdc00b9e5e732 (patch)
tree3522ee5b042aa612177391edadbe955f589c3a0d /hw/9pfs/cofs.c
parentae1ef571fc4ce5cc016311a030357c6a8d851dfe (diff)
downloadqemu-2a487e05def38b73ae25db61f62fdc00b9e5e732.zip
qemu-2a487e05def38b73ae25db61f62fdc00b9e5e732.tar.gz
qemu-2a487e05def38b73ae25db61f62fdc00b9e5e732.tar.bz2
hw/9pfs: Add yeild support to rename coroutine
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'hw/9pfs/cofs.c')
-rw-r--r--hw/9pfs/cofs.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/hw/9pfs/cofs.c b/hw/9pfs/cofs.c
index 8fbfe73..473ce53 100644
--- a/hw/9pfs/cofs.c
+++ b/hw/9pfs/cofs.c
@@ -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;
+}