summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Schoenebeck <qemu_oss@crudebyte.com>2026-05-18 19:35:56 +0200
committerMichael Tokarev <mjt@tls.msk.ru>2026-06-01 21:02:55 +0300
commita71e1a8cd19340f7cf1f349efefcb8ed71fb3097 (patch)
treee52d407b767b2c7240a133a4e5cd7cc272df9615
parent658deac8ccb63ee686e082b1b8ad9c1f67064b62 (diff)
downloadqemu-a71e1a8cd19340f7cf1f349efefcb8ed71fb3097.tar.gz
qemu-a71e1a8cd19340f7cf1f349efefcb8ed71fb3097.zip
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> (cherry picked from commit 54dd352c59269fdb5241e7b6dbcecaff107e7f5a) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
-rw-r--r--hw/9pfs/9p.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index c439fecf5c..a4ebbce5d6 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -1407,13 +1407,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)