From a5d293c18831dcf69ec6195798387fbb70c9f461 Mon Sep 17 00:00:00 2001 From: Wang Huaqiang Date: Mon, 27 Aug 2018 19:23:04 +0800 Subject: [PATCH] conf: Renamed 'controlBuf' to 'childrenBuf' To add CMT/MBM feature and let code be consistent in later patches, renaming variable name from 'controlBuf' to 'childrenBuf', locates in functions 'virCapabilitiesFormatCaches' and 'virCapabilitiesFormatMemoryBandwidth'. Signed-off-by: Wang Huaqiang Reviewed-by: John Ferlan --- src/conf/capabilities.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 6b60fbc94d..326bd15cee 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -873,7 +873,7 @@ virCapabilitiesFormatCaches(virBufferPtr buf, { size_t i = 0; size_t j = 0; - virBuffer controlBuf = VIR_BUFFER_INITIALIZER; + virBuffer childrenBuf = VIR_BUFFER_INITIALIZER; if (!ncaches) return 0; @@ -902,7 +902,7 @@ virCapabilitiesFormatCaches(virBufferPtr buf, short_size, unit, cpus_str); VIR_FREE(cpus_str); - virBufferSetChildIndent(&controlBuf, buf); + virBufferSetChildIndent(&childrenBuf, buf); for (j = 0; j < bank->ncontrols; j++) { const char *min_unit; virResctrlInfoPerCachePtr controls = bank->controls[j]; @@ -928,26 +928,26 @@ virCapabilitiesFormatCaches(virBufferPtr buf, } } - virBufferAsprintf(&controlBuf, + virBufferAsprintf(&childrenBuf, "\n", unit, virCacheTypeToString(controls->scope), controls->max_allocation); } - if (virBufferCheckError(&controlBuf) < 0) + if (virBufferCheckError(&childrenBuf) < 0) return -1; - if (virBufferUse(&controlBuf)) { + if (virBufferUse(&childrenBuf)) { virBufferAddLit(buf, ">\n"); - virBufferAddBuffer(buf, &controlBuf); + virBufferAddBuffer(buf, &childrenBuf); virBufferAddLit(buf, "\n"); } else { virBufferAddLit(buf, "/>\n"); @@ -966,7 +966,7 @@ virCapabilitiesFormatMemoryBandwidth(virBufferPtr buf, virCapsHostMemBWNodePtr *nodes) { size_t i = 0; - virBuffer controlBuf = VIR_BUFFER_INITIALIZER; + virBuffer childrenBuf = VIR_BUFFER_INITIALIZER; if (!nnodes) return 0; @@ -987,19 +987,19 @@ virCapabilitiesFormatMemoryBandwidth(virBufferPtr buf, node->id, cpus_str); VIR_FREE(cpus_str); - virBufferSetChildIndent(&controlBuf, buf); - virBufferAsprintf(&controlBuf, + virBufferSetChildIndent(&childrenBuf, buf); + virBufferAsprintf(&childrenBuf, "\n", control->granularity, control->min, control->max_allocation); - if (virBufferCheckError(&controlBuf) < 0) + if (virBufferCheckError(&childrenBuf) < 0) return -1; - if (virBufferUse(&controlBuf)) { + if (virBufferUse(&childrenBuf)) { virBufferAddLit(buf, ">\n"); - virBufferAddBuffer(buf, &controlBuf); + virBufferAddBuffer(buf, &childrenBuf); virBufferAddLit(buf, "\n"); } else { virBufferAddLit(buf, "/>\n");