mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
nodeinfo: fix nodeGetFreePages when max node is zero
In nodeGetFreePages, if startCell is given by '0', and the max node number is '0' too. The for-loop wouldn't be executed. So convert it to while-loop. Before: > virsh freepages --cellno 0 --pagesize 4 error: internal error: no suitable info found After: > virsh freepages --cellno 0 --pagesize 4 4KiB: 472637 Signed-off-by: Jincheng Miao <jmiao@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
0114a1e703
commit
8baf0f025f
@ -2043,7 +2043,7 @@ nodeGetFreePages(unsigned int npages,
|
||||
|
||||
lastCell = MIN(lastCell, startCell + cellCount);
|
||||
|
||||
for (cell = startCell; cell < lastCell; cell++) {
|
||||
for (cell = startCell; cell <= lastCell; cell++) {
|
||||
for (i = 0; i < npages; i++) {
|
||||
unsigned int page_size = pages[i];
|
||||
unsigned int page_free;
|
||||
|
Loading…
x
Reference in New Issue
Block a user