]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: Document limitation of virFileCanonicalizePath
authorJiri Denemark <jdenemar@redhat.com>
Wed, 28 May 2025 14:34:18 +0000 (16:34 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 2 Jun 2025 08:03:08 +0000 (10:03 +0200)
On most platforms virFileCanonicalizePath is implemented using
realpath(), which only works on existing paths.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virfile.c

index 7cab3d0cd6732fae7c680bfe623f451be3963a54..242aa7ff88ff8e3f37e146ca924dec8a9385bdd5 100644 (file)
@@ -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.
  */