[PATCH 2/3] Add lots of debugging to storage file probing code

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 src/util/storage_file.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/util/storage_file.c b/src/util/storage_file.c
index 4281d90..69a66ff 100644
--- a/src/util/storage_file.c
+++ b/src/util/storage_file.c
@@ -628,6 +628,9 @@ virStorageFileMatchesVersion(int format,
             (buf[fileTypeInfo[format].versionOffset+2] << 8) |
             (buf[fileTypeInfo[format].versionOffset+3]);
     }
+
+    VIR_DEBUG("Compare version %d vs %d",
+              version, fileTypeInfo[format].versionNumber);
     if (version != fileTypeInfo[format].versionNumber)
         return false;
 
@@ -650,6 +653,8 @@ virStorageFileGetMetadataFromBuf(int format,
                                  size_t buflen,
                                  virStorageFileMetadata *meta)
 {
+    VIR_DEBUG("path=%s format=%d", path, format);
+
     /* XXX we should consider moving virStorageBackendUpdateVolInfo
      * code into this method, for non-magic files
      */
@@ -785,6 +790,7 @@ virStorageFileProbeFormatFromBuf(const char *path,
     }
 
 cleanup:
+    VIR_DEBUG("format=%d", format);
     return format;
 }
 
@@ -963,6 +969,9 @@ virStorageFileGetMetadataRecurse(const char *path, int format,
                                  bool allow_probe, virHashTablePtr cycle)
 {
     int fd;
+    VIR_DEBUG("path=%s format=%d uid=%d gid=%d probe=%d",
+              path, format, (int)uid, (int)gid, allow_probe);
+
     virStorageFileMetadataPtr ret = NULL;
 
     if (virHashLookup(cycle, path)) {
@@ -1027,6 +1036,9 @@ virStorageFileGetMetadata(const char *path, int format,
                           uid_t uid, gid_t gid,
                           bool allow_probe)
 {
+    VIR_DEBUG("path=%s format=%d uid=%d gid=%d probe=%d",
+              path, format, (int)uid, (int)gid, allow_probe);
+
     virHashTablePtr cycle = virHashCreate(5, NULL);
     virStorageFileMetadataPtr ret;
 
-- 
1.7.11.7

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