From ee4231ae67eab1ddb5054cfa39dced5ebd4ce6d4 Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Wed, 28 May 2025 16:34:18 +0200 Subject: [PATCH] util: Document limitation of virFileCanonicalizePath MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit On most platforms virFileCanonicalizePath is implemented using realpath(), which only works on existing paths. Signed-off-by: Jiri Denemark Reviewed-by: Ján Tomko --- src/util/virfile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 7cab3d0cd6..242aa7ff88 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -3408,7 +3408,8 @@ virFileSanitizePath(const char *path) /** * virFileCanonicalizePath: * - * Returns the canonical representation of @path. + * Returns the canonical representation of @path. This function is only + * guaranteed to work when @path exists. It may return NULL otherwise. * * The returned string must be freed after use. */ -- 2.47.2