diff --git a/hw/9pfs/cofs.c b/hw/9pfs/cofs.c index 6fcedd8400850b6f2e9056ce2f6fcff8b55c44a1..8fbfe7359f4ba19f3b04377539128e5965720ace 100644 --- a/hw/9pfs/cofs.c +++ b/hw/9pfs/cofs.c @@ -141,3 +141,17 @@ int v9fs_co_mknod(V9fsState *s, V9fsString *path, uid_t uid, }); return err; } + +int v9fs_co_remove(V9fsState *s, V9fsString *path) +{ + int err; + + v9fs_co_run_in_worker( + { + err = s->ops->remove(&s->ctx, path->data); + if (err < 0) { + err = -errno; + } + }); + return err; +} diff --git a/hw/9pfs/virtio-9p-coth.h b/hw/9pfs/virtio-9p-coth.h index 96e88d8656264fcc5b728858f1e3affaa6d4de40..60795c48fa80e28de815e99fbcfeb95b96338a57 100644 --- a/hw/9pfs/virtio-9p-coth.h +++ b/hw/9pfs/virtio-9p-coth.h @@ -74,4 +74,5 @@ extern int v9fs_co_lgetxattr(V9fsState *, V9fsString *, 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 *); #endif