[PATCH 03/18] util: storage: Don't force path canonicalization when loading metadata

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Avoid breaking gluster volumes that don't have local representation. Use
the provided name when canonicalization fails. Broken by commit 79f11b35

Fixes:
 $ virsh pool-start glusterpool
 error: Failed to start pool glusterpool
 error: unable to resolve 'asdf': No such file or directory
---
 src/util/virstoragefile.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 5fbb6e7..c707200 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -1012,10 +1012,12 @@ virStorageFileGetMetadataFromBuf(const char *path,
     virStorageFileMetadataPtr ret = NULL;
     char *canonPath;

-    if (!(canonPath = canonicalize_file_name(path))) {
+    if (!(canonPath = canonicalize_file_name(path)) &&
+        VIR_STRDUP(canonPath, path) < 0) {
         virReportSystemError(errno, _("unable to resolve '%s'"), path);
         return NULL;
     }
+
     if (VIR_ALLOC(ret) < 0)
         goto cleanup;

-- 
1.9.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]