]> xenbits.xensource.com Git - libvirt.git/commitdiff
storagefile: Rename qcow2GetExtensions 'format' argument
authorCole Robinson <crobinso@redhat.com>
Fri, 4 Oct 2019 22:47:24 +0000 (18:47 -0400)
committerCole Robinson <crobinso@redhat.com>
Fri, 11 Oct 2019 17:41:22 +0000 (13:41 -0400)
To backingFormat, which makes it more clear. Move it to the end of
the argument list which will scale nicer with future patches

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
src/util/virstoragefile.c

index d6bd38777b20652069fa6caa45a91622199ed087..8cd576a463850d054702285a379e6d7c012d2fe3 100644 (file)
@@ -427,9 +427,9 @@ cowGetBackingStore(char **res,
 
 
 static int
-qcow2GetExtensions(int *format,
-                   const char *buf,
-                   size_t buf_size)
+qcow2GetExtensions(const char *buf,
+                   size_t buf_size,
+                   int *backingFormat)
 {
     size_t offset;
     size_t extension_start;
@@ -509,8 +509,8 @@ qcow2GetExtensions(int *format,
         case QCOW2_HDR_EXTENSION_BACKING_FORMAT:
             if (buf[offset+len] != '\0')
                 break;
-            *format = virStorageFileFormatTypeFromString(buf+offset);
-            if (*format <= VIR_STORAGE_FILE_NONE)
+            *backingFormat = virStorageFileFormatTypeFromString(buf+offset);
+            if (*backingFormat <= VIR_STORAGE_FILE_NONE)
                 return -1;
         }
 
@@ -561,7 +561,7 @@ qcowXGetBackingStore(char **res,
     memcpy(*res, buf + offset, size);
     (*res)[size] = '\0';
 
-    if (qcow2GetExtensions(format, buf, buf_size) < 0)
+    if (qcow2GetExtensions(buf, buf_size, format) < 0)
         return BACKING_STORE_INVALID;
 
     return BACKING_STORE_OK;