util: introduce MIN_NON_ZERO
authorPeter Lieven <pl@kamp.de>
Mon, 27 Oct 2014 09:18:43 +0000 (10:18 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 3 Nov 2014 09:48:41 +0000 (09:48 +0000)
commitac3a8726644d4783eacf54212d23db01d1d30044
tree765e54ea8d8dd2358dccf344835843250f730307
parent0a2923f8488498000eec54871456aa64a4391da4
util: introduce MIN_NON_ZERO

at least in block layer we have the case of limits being defined for a
BlockDriverState. However, in this context often zero (0) has the special
meanining of undefined which means no limit. If two of those limits are
combined and the minimum is needed the minimum function should only return
zero if both parameters are zero.

Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
include/qemu/osdep.h