mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
virCapabilitiesHostNUMAFormat: Bring variables into loops
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
32c887e4b7
commit
b24a45827a
@ -807,8 +807,6 @@ virCapabilitiesHostNUMAFormat(virBuffer *buf,
|
|||||||
virCapsHostNUMA *caps)
|
virCapsHostNUMA *caps)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
size_t j;
|
|
||||||
char *siblings;
|
|
||||||
|
|
||||||
if (!caps)
|
if (!caps)
|
||||||
return 0;
|
return 0;
|
||||||
@ -819,6 +817,8 @@ virCapabilitiesHostNUMAFormat(virBuffer *buf,
|
|||||||
virBufferAdjustIndent(buf, 2);
|
virBufferAdjustIndent(buf, 2);
|
||||||
for (i = 0; i < caps->cells->len; i++) {
|
for (i = 0; i < caps->cells->len; i++) {
|
||||||
virCapsHostNUMACell *cell = g_ptr_array_index(caps->cells, i);
|
virCapsHostNUMACell *cell = g_ptr_array_index(caps->cells, i);
|
||||||
|
size_t j;
|
||||||
|
|
||||||
virBufferAsprintf(buf, "<cell id='%d'>\n", cell->num);
|
virBufferAsprintf(buf, "<cell id='%d'>\n", cell->num);
|
||||||
virBufferAdjustIndent(buf, 2);
|
virBufferAdjustIndent(buf, 2);
|
||||||
|
|
||||||
@ -851,6 +851,8 @@ virCapabilitiesHostNUMAFormat(virBuffer *buf,
|
|||||||
virBufferAsprintf(buf, "<cpu id='%d'", cell->cpus[j].id);
|
virBufferAsprintf(buf, "<cpu id='%d'", cell->cpus[j].id);
|
||||||
|
|
||||||
if (cell->cpus[j].siblings) {
|
if (cell->cpus[j].siblings) {
|
||||||
|
g_autofree char *siblings = NULL;
|
||||||
|
|
||||||
if (!(siblings = virBitmapFormat(cell->cpus[j].siblings)))
|
if (!(siblings = virBitmapFormat(cell->cpus[j].siblings)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -860,7 +862,6 @@ virCapabilitiesHostNUMAFormat(virBuffer *buf,
|
|||||||
cell->cpus[j].die_id,
|
cell->cpus[j].die_id,
|
||||||
cell->cpus[j].core_id,
|
cell->cpus[j].core_id,
|
||||||
siblings);
|
siblings);
|
||||||
VIR_FREE(siblings);
|
|
||||||
}
|
}
|
||||||
virBufferAddLit(buf, "/>\n");
|
virBufferAddLit(buf, "/>\n");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user