summaryrefslogtreecommitdiff
path: root/src/util/vircgroupv1.c
diff options
context:
space:
mode:
authorJán Tomko <jtomko@redhat.com>2019-10-15 13:55:26 +0200
committerJán Tomko <jtomko@redhat.com>2019-10-15 16:14:19 +0200
commit67e72053c1de2457bd23af52ee6d448598dbae26 (patch)
tree01af50ef95bbe86ab54fb89f263f4e96660f209c /src/util/vircgroupv1.c
parentd99f17a502f9c8a5d6fe2fa12961f46cae59cc5c (diff)
downloadlibvirt-67e72053c1de2457bd23af52ee6d448598dbae26.tar.gz
Use G_N_ELEMENTS instead of ARRAY_CARDINALITY
Prefer the GLib version of the macro. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Diffstat (limited to 'src/util/vircgroupv1.c')
-rw-r--r--src/util/vircgroupv1.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/vircgroupv1.c b/src/util/vircgroupv1.c
index 23908d769d..dcf8e3383b 100644
--- a/src/util/vircgroupv1.c
+++ b/src/util/vircgroupv1.c
@@ -555,7 +555,7 @@ virCgroupV1CpuSetInherit(virCgroupPtr parent,
};
VIR_DEBUG("Setting up inheritance %s -> %s", parent->path, group->path);
- for (i = 0; i < ARRAY_CARDINALITY(inherit_values); i++) {
+ for (i = 0; i < G_N_ELEMENTS(inherit_values); i++) {
VIR_AUTOFREE(char *) value = NULL;
if (virCgroupGetValueStr(parent,
@@ -1065,7 +1065,7 @@ virCgroupV1GetBlkioIoServiced(virCgroupPtr group,
return -1;
/* sum up all entries of the same kind, from all devices */
- for (i = 0; i < ARRAY_CARDINALITY(value_names); i++) {
+ for (i = 0; i < G_N_ELEMENTS(value_names); i++) {
p1 = str1;
p2 = str2;
@@ -1171,7 +1171,7 @@ virCgroupV1GetBlkioIoDeviceServiced(virCgroupPtr group,
return -1;
}
- for (i = 0; i < ARRAY_CARDINALITY(value_names); i++) {
+ for (i = 0; i < G_N_ELEMENTS(value_names); i++) {
if (!(p1 = strstr(p1, value_names[i]))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot find byte %sstats for block device '%s'"),