From: Peter Krempa <[email protected]>

Document that the caller doesn't have to populate the field as it's used
only for VIR_DEBUG and optional VIR_WARN calls.

Signed-off-by: Peter Krempa <[email protected]>
---
 src/storage_file/storage_file_probe.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/storage_file/storage_file_probe.c 
b/src/storage_file/storage_file_probe.c
index ff6512db77..8fa84a796e 100644
--- a/src/storage_file/storage_file_probe.c
+++ b/src/storage_file/storage_file_probe.c
@@ -960,8 +960,10 @@ virStorageFileGetEncryptionPayloadOffset(const struct 
FileEncryptionInfo *info,
 /* Given a header in BUF with length LEN, as parsed from the storage file
  * assuming it has the given FORMAT, populate information into META
  * with information about the file and its backing store. Return format
- * of the backing store as BACKING_FORMAT. PATH and FORMAT have to be
- * pre-populated in META.
+ * of the backing store as BACKING_FORMAT.
+ *
+ * 'meta->format' and 'meta->path' are expected to be pre-populated although
+ * 'meta->path' may be NULL as the value is used only in debug messages.
  *
  * Note that this function may be called repeatedly on @meta, so it must
  * clean up any existing allocated memory which would be overwritten.
@@ -974,7 +976,7 @@ virStorageFileProbeGetMetadata(virStorageSource *meta,
     size_t i;

     VIR_DEBUG("path=%s, buf=%p, len=%zu, meta->format=%d",
-              meta->path, buf, len, meta->format);
+              NULLSTR(meta->path), buf, len, meta->format);

     if (meta->format == VIR_STORAGE_FILE_AUTO)
         meta->format = virStorageFileProbeFormatFromBuf(meta->path, buf, len);
-- 
2.54.0

Reply via email to