@samitouri / QOSamiQemu / commits / 54dd352c59

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>

Christian Schoenebeck committed May 18, 2026 at 19:35 UTC 54dd352c59269fdb5241e7b6dbcecaff107e7f5a
1 file changed +4 -2
hw/9pfs/9p.c
+4 -2
@@ -1417,13 +1417,15 @@ static void print_sg(struct iovec *sg, int cnt)
1417 }
1418
1419 /* Will call this only for path name based fid */
1420 -static void v9fs_fix_path(V9fsPath *dst, V9fsPath *src, int len)
1420 +static int v9fs_fix_path(V9fsPath *dst, V9fsPath *src, int len)
1421 {
1422 V9fsPath str;
1423 + int ret;
1424 v9fs_path_init(&str);
1425 v9fs_path_copy(&str, dst);
1425 - v9fs_path_sprintf(dst, "%s%s", src->data, str.data + len);
1426 + ret = v9fs_path_sprintf(dst, "%s%s", src->data, str.data + len);
1427 v9fs_path_free(&str);
1428 + return ret;
1429 }
1430
1431 static inline bool is_ro_export(FsContext *ctx)