aboutsummaryrefslogtreecommitdiff
path: root/hw/9pfs/virtio-9p.h
diff options
context:
space:
mode:
Diffstat (limited to 'hw/9pfs/virtio-9p.h')
-rw-r--r--hw/9pfs/virtio-9p.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/9pfs/virtio-9p.h b/hw/9pfs/virtio-9p.h
index 27f997073a..2bfbe622af 100644
--- a/hw/9pfs/virtio-9p.h
+++ b/hw/9pfs/virtio-9p.h
@@ -101,6 +101,11 @@ enum p9_proto_version {
#define P9_NOTAG (u16)(~0)
#define P9_NOFID (u32)(~0)
#define P9_MAXWELEM 16
+static inline const char *rpath(FsContext *ctx, const char *path, char *buffer)
+{
+ snprintf(buffer, PATH_MAX, "%s/%s", ctx->fs_root, path);
+ return buffer;
+}
/*
* ample room for Twrite/Rread header