From: Bing Bu Cao <mars(a)linux.vnet.ibm.com>
The helper function virCompareLimitUlong compare limit values,
where value of 0 is equal to unlimited, if the latter parameter is 0,
it should return -1 instead of 1, hence the user can only set hard_limit when
swap_hard_limit currently is unlimited.
Signed-off-by: Bing Bu Cao <mars(a)linux.vnet.ibm.com>
---
src/util/virutil.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/util/virutil.c b/src/util/virutil.c
index d9e0bc4..3dcf1fe 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -2067,6 +2067,9 @@ virCompareLimitUlong(unsigned long long a, unsigned long b)
if (a == b)
return 0;
+ if (0 == b)
+ return -1;
+
if (a == 0 || a > b)
return 1;
--
1.7.7.6