Commit 54dd352c59 for qemu.org
commit 54dd352c59269fdb5241e7b6dbcecaff107e7f5a
Author: Christian Schoenebeck <qemu_oss@crudebyte.com>
Date: Mon May 18 19:35:56 2026 +0200
hw/9pfs: add error handling to v9fs_fix_path()
Update v9fs_fix_path() to return int and propagate errors from
v9fs_path_sprintf(). This allows callers to detect and handle
path formatting failures.
Link: https://lore.kernel.org/qemu-devel/a0592741a918b7cbe751980ec7ec0c03f505924c.1779126034.git.qemu_oss@crudebyte.com
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 88894ec9d2..d704de644f 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -1417,13 +1417,15 @@ static void print_sg(struct iovec *sg, int cnt)
}
/* Will call this only for path name based fid */
-static void v9fs_fix_path(V9fsPath *dst, V9fsPath *src, int len)
+static int v9fs_fix_path(V9fsPath *dst, V9fsPath *src, int len)
{
V9fsPath str;
+ int ret;
v9fs_path_init(&str);
v9fs_path_copy(&str, dst);
- v9fs_path_sprintf(dst, "%s%s", src->data, str.data + len);
+ ret = v9fs_path_sprintf(dst, "%s%s", src->data, str.data + len);
v9fs_path_free(&str);
+ return ret;
}
static inline bool is_ro_export(FsContext *ctx)