]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virCapabilitiesHostNUMAFormat: Swap order of arguments
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 3 May 2021 13:25:19 +0000 (15:25 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 10 May 2021 13:16:13 +0000 (15:16 +0200)
The rest of virCapabilities format functions take virBuffer as
the first argument and struct to format as the second. Also, they
accept NULL (as the second argument). Fix
virCapabilitiesHostNUMAFormat() so that it follows this logic.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/capabilities.c

index 9bd59b3cbff9666c388868f2021029bf1436f906..084e09286d045898be7bbe0ad7cb95e2e81d2b71 100644 (file)
@@ -794,13 +794,16 @@ virCapabilitiesAddStoragePool(virCaps *caps,
 
 
 static int
-virCapabilitiesHostNUMAFormat(virCapsHostNUMA *caps,
-                              virBuffer *buf)
+virCapabilitiesHostNUMAFormat(virBuffer *buf,
+                              virCapsHostNUMA *caps)
 {
     size_t i;
     size_t j;
     char *siblings;
 
+    if (!caps)
+        return 0;
+
     virBufferAddLit(buf, "<topology>\n");
     virBufferAdjustIndent(buf, 2);
     virBufferAsprintf(buf, "<cells num='%d'>\n", caps->cells->len);
@@ -1125,8 +1128,7 @@ virCapabilitiesFormatHostXML(virCapsHost *host,
         virBufferAsprintf(buf, "<netprefix>%s</netprefix>\n",
                           host->netprefix);
 
-    if (host->numa &&
-        virCapabilitiesHostNUMAFormat(host->numa, buf) < 0)
+    if (virCapabilitiesHostNUMAFormat(buf, host->numa) < 0)
         return -1;
 
     if (virCapabilitiesFormatCaches(buf, &host->cache) < 0)