]> xenbits.xensource.com Git - xen.git/commit
tools: libxl: Simplify logic in libxl__realloc
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 18 Feb 2016 12:37:04 +0000 (12:37 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 18 Feb 2016 18:22:12 +0000 (18:22 +0000)
commit435bbbc9af0f38d304e8be3a1ba00b99af530d60
tree6737c2fbdbf5cb4950a369626a189c3e606480af
parente1ff823b65ae004e4aa3fe9a94078ef82816dee9
tools: libxl: Simplify logic in libxl__realloc

Replace the loop exit and separate test for loop overrun with an
assert in the loop body.

This simplifies the code.  It also (hopefully) avoids Coverity
thinking that gc->alloc_maxsize might change, resulting in the loop
failing to find the right answer but also failing to abort.

(gc->alloc_maxsize can't change because gcs are all singlethreaded:
either they are on the stack of a specific thread, or they belong to
an ao and are covered by the ctx lock.)

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl_internal.c