From: Michal Privoznik Date: Mon, 3 May 2021 13:25:19 +0000 (+0200) Subject: virCapabilitiesHostNUMAFormat: Swap order of arguments X-Git-Tag: v7.4.0-rc1~177 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2137a901cb18e7b68597d6a93bc9b9f49ee8fe2;p=thirdparty%2Flibvirt.git virCapabilitiesHostNUMAFormat: Swap order of arguments 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 Reviewed-by: Ján Tomko --- diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 9bd59b3cbf..084e09286d 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -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, "\n"); virBufferAdjustIndent(buf, 2); virBufferAsprintf(buf, "\n", caps->cells->len); @@ -1125,8 +1128,7 @@ virCapabilitiesFormatHostXML(virCapsHost *host, virBufferAsprintf(buf, "%s\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)