[PATCH 03/30] storagefile: qcow1: Fix check for empty backing file

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

 



>From f772b3d91fd the intention of this code seems to be to set
format=NONE when the image does not have a backing file. However
'buf' here is the whole qcow1 file header. What we want to be
checking is 'res' which is the parsed backing file path.
qcowXGetBackingStore sets this to NULL when there's no backing file.

Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx>
---
 src/util/virstoragefile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 1549067c48..016c8f0799 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -578,7 +578,7 @@ qcow1GetBackingStore(char **res,
      * used to store backing format */
     *format = VIR_STORAGE_FILE_AUTO;
     ret = qcowXGetBackingStore(res, NULL, buf, buf_size, false);
-    if (ret == BACKING_STORE_OK && *buf == '\0')
+    if (ret == BACKING_STORE_OK && !*res)
         *format = VIR_STORAGE_FILE_NONE;
     return ret;
 }
-- 
2.23.0

--
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]

  Powered by Linux