Consider the following scenario:
virsh # freecell --all
0: 2048 KiB
1: 4096 KiB
--------------------
Total: 6144 KiB
virsh # freecell 0
0: 2048 KiB
virsh # freecell 1
1: 4096 KiB
And now before this change:
virsh # freecell 2
After this change:
virsh # freecell 2
error: invalid argument: Range exceeds available cells
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
int ret = -1;
testDriverLock(privconn);
- if (startCell > privconn->numCells) {
+ if (startCell >= privconn->numCells) {
virReportError(VIR_ERR_INVALID_ARG,
"%s", _("Range exceeds available cells"));
goto cleanup;