9119d9
From bc849e9b9d3b7bf3d8240a2a5da4d3ad6282d9f3 Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <bc849e9b9d3b7bf3d8240a2a5da4d3ad6282d9f3@dist-git>
9119d9
From: John Ferlan <jferlan@redhat.com>
9119d9
Date: Mon, 15 Sep 2014 15:13:57 -0400
9119d9
Subject: [PATCH] domain_conf: Resolve Coverity COPY_PASTE_ERROR
9119d9
9119d9
https://bugzilla.redhat.com/show_bug.cgi?id=1141209
9119d9
9119d9
Seems when commit id 'ea130e3b' added the checks to ensure each of
9119d9
the hard_limit, soft_limit, and swap_hard_limit wasn't set at
9119d9
VIR_DOMAIN_MEMORY_PARAM_UNLIMITED - a copy/paste error of using
9119d9
the 'hard_limit' for each comparison was done. Adjust the code.
9119d9
9119d9
(cherry picked from commit 96aa6052a14379eca23e0ba428355e5c1dab7e04)
9119d9
Signed-off-by: John Ferlan <jferlan@redhat.com>
9119d9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9119d9
---
9119d9
 src/conf/domain_conf.c | 4 ++--
9119d9
 1 file changed, 2 insertions(+), 2 deletions(-)
9119d9
9119d9
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
9119d9
index 84f5f1d..ea727a1 100644
9119d9
--- a/src/conf/domain_conf.c
9119d9
+++ b/src/conf/domain_conf.c
9119d9
@@ -18036,9 +18036,9 @@ virDomainDefFormatInternal(virDomainDefPtr def,
9119d9
     if ((def->mem.hard_limit &&
9119d9
          def->mem.hard_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) ||
9119d9
         (def->mem.soft_limit &&
9119d9
-         def->mem.hard_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) ||
9119d9
+         def->mem.soft_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) ||
9119d9
         (def->mem.swap_hard_limit &&
9119d9
-         def->mem.hard_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) ||
9119d9
+         def->mem.swap_hard_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) ||
9119d9
         def->mem.min_guarantee) {
9119d9
         virBufferAddLit(buf, "<memtune>\n");
9119d9
         virBufferAdjustIndent(buf, 2);
9119d9
-- 
9119d9
2.1.0
9119d9