summary refs log tree commit diff stats
path: root/hw/9pfs/cofs.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-08-25 07:48:15 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-25 07:48:15 -0500
commit444dc48298c480e42e15a8fe676be737d8a6b2a1 (patch)
treebc76c5afaa746c8c27d0457e2035fe38ee45fb6c /hw/9pfs/cofs.c
parent5b15f27516ce3249c80bd2e0458d8d61f20da415 (diff)
parent5f524c1ebcc5e0dec0de8940d34f9adb3c7887a1 (diff)
downloadfocaccia-qemu-444dc48298c480e42e15a8fe676be737d8a6b2a1.tar.gz
focaccia-qemu-444dc48298c480e42e15a8fe676be737d8a6b2a1.zip
Merge remote-tracking branch 'aneesh/for-upstream-2' into staging
Diffstat (limited to 'hw/9pfs/cofs.c')
-rw-r--r--hw/9pfs/cofs.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/hw/9pfs/cofs.c b/hw/9pfs/cofs.c
index 1f10632540..a78fccbe23 100644
--- a/hw/9pfs/cofs.c
+++ b/hw/9pfs/cofs.c
@@ -169,3 +169,23 @@ int v9fs_co_rename(V9fsState *s, V9fsString *oldpath, V9fsString *newpath)
         });
     return err;
 }
+
+int v9fs_co_symlink(V9fsState *s, V9fsFidState *fidp,
+                    const char *oldpath, const char *newpath, gid_t gid)
+{
+    int err;
+    FsCred cred;
+
+    cred_init(&cred);
+    cred.fc_uid = fidp->uid;
+    cred.fc_gid = gid;
+    cred.fc_mode = 0777;
+    v9fs_co_run_in_worker(
+        {
+            err = s->ops->symlink(&s->ctx, oldpath, newpath, &cred);
+            if (err < 0) {
+                err = -errno;
+            }
+        });
+    return err;
+}