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 <huaqiang.wang@intel.com>
---
.gnulib | 1 -
src/conf/capabilities.c | 28 ++++++++++++++--------------
2 files changed, 14 insertions(+), 15 deletions(-)
delete mode 160000 .gnulib
diff --git a/.gnulib b/.gnulib
deleted file mode 160000
index 68df637..0000000
--- a/.gnulib
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 68df637b5f1b5c10370f6981d2a43a5cf74368df
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index 6b60fbc..326bd15 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,
"<control granularity='%llu'",
gran_short_size);
if (min_short_size)
- virBufferAsprintf(&controlBuf, " min='%llu'", min_short_size);
+ virBufferAsprintf(&childrenBuf, " min='%llu'", min_short_size);
- virBufferAsprintf(&controlBuf,
+ virBufferAsprintf(&childrenBuf,
" unit='%s' type='%s' maxAllocs='%u'/>\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, "</bank>\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,
"<control granularity='%u' min ='%u' "
"maxAllocs='%u'/>\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, "</node>\n");
} else {
virBufferAddLit(buf, "/>\n");
--
2.7.4
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
On 08/27/2018 07:23 AM, Wang Huaqiang wrote: > 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 <huaqiang.wang@intel.com> > --- > .gnulib | 1 - Gaah!!! Don't do that! > src/conf/capabilities.c | 28 ++++++++++++++-------------- > 2 files changed, 14 insertions(+), 15 deletions(-) > delete mode 160000 .gnulib > > diff --git a/.gnulib b/.gnulib > deleted file mode 160000 > index 68df637..0000000 > --- a/.gnulib > +++ /dev/null > @@ -1 +0,0 @@ > -Subproject commit 68df637b5f1b5c10370f6981d2a43a5cf74368df Luckily I can delete this hunk out of my .eml file before git am'ing the series. The rest is fine by me, allows childrenBuf to catch up with childBuf variables. At least in this case there's multiple elements within for loops being added as opposed to some other uses where there's just one. Reviewed-by: John Ferlan <jferlan@redhat.com> John -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
> -----Original Message----- > From: John Ferlan [mailto:jferlan@redhat.com] > Sent: Wednesday, September 5, 2018 7:58 PM > To: Wang, Huaqiang <huaqiang.wang@intel.com>; libvir-list@redhat.com > Cc: Feng, Shaohe <shaohe.feng@intel.com>; Niu, Bing <bing.niu@intel.com>; > Ding, Jian-feng <jian-feng.ding@intel.com>; Zang, Rui <rui.zang@intel.com> > Subject: Re: [libvirt] [PATCH 01/10] conf: Renamed 'controlBuf' to 'childrenBuf' > Hi John, Thanks for review. Will address your comments in each separate email. BR Huaqiang > > > On 08/27/2018 07:23 AM, Wang Huaqiang wrote: > > 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 <huaqiang.wang@intel.com> > > --- > > .gnulib | 1 - > > Gaah!!! > > Don't do that! Will be removed. > > > src/conf/capabilities.c | 28 ++++++++++++++-------------- > > 2 files changed, 14 insertions(+), 15 deletions(-) delete mode > > 160000 .gnulib > > > > diff --git a/.gnulib b/.gnulib > > deleted file mode 160000 > > index 68df637..0000000 > > --- a/.gnulib > > +++ /dev/null > > @@ -1 +0,0 @@ > > -Subproject commit 68df637b5f1b5c10370f6981d2a43a5cf74368df > > Luckily I can delete this hunk out of my .eml file before git am'ing the series. > > The rest is fine by me, allows childrenBuf to catch up with childBuf variables. At > least in this case there's multiple elements within for loops being added as > opposed to some other uses where there's just one. > Thanks. > Reviewed-by: John Ferlan <jferlan@redhat.com> > > John -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
© 2016 - 2025 Red Hat, Inc.