From 2a487e05def38b73ae25db61f62fdc00b9e5e732 Mon Sep 17 00:00:00 2001 From: "Aneesh Kumar K.V" Date: Sat, 7 May 2011 16:09:10 +0530 Subject: hw/9pfs: Add yeild support to rename coroutine Signed-off-by: Aneesh Kumar K.V --- hw/9pfs/cofs.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'hw/9pfs/cofs.c') diff --git a/hw/9pfs/cofs.c b/hw/9pfs/cofs.c index 8fbfe7359f..473ce53568 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; +} -- cgit v1.2.1