]> git.proxmox.com Git - qemu.git/blobdiff - hw/9pfs/cofs.c
hw/9pfs: Add yeild support to rename coroutine
[qemu.git] / hw / 9pfs / cofs.c
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;
+}