]> git.ipfire.org Git - thirdparty/libvirt.git/commit
testNodeGetCellsFreeMemory: Fix off by one error
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 15 Sep 2016 15:42:36 +0000 (17:42 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 13 Oct 2016 01:26:41 +0000 (09:26 +0800)
commite1a33ed18c0200e26d92eb2900943573fc0f7d60
treefbfcbb49845d55518bf682d58d619e3b551e69b9
parentc72690e27915c3a8f0c0c79d8406d82555804b39
testNodeGetCellsFreeMemory: Fix off by one error

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>
src/test/test_driver.c