]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
domain_conf: Resolve Coverity COPY_PASTE_ERROR
authorJohn Ferlan <jferlan@redhat.com>
Fri, 12 Sep 2014 11:52:39 +0000 (07:52 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 15 Sep 2014 14:44:27 +0000 (10:44 -0400)
Seems when commit id 'ea130e3b' added the checks to ensure each of
the hard_limit, soft_limit, and swap_hard_limit wasn't set at
VIR_DOMAIN_MEMORY_PARAM_UNLIMITED - a copy/paste error of using
the 'hard_limit' for each comparison was done. Adjust the code.

src/conf/domain_conf.c

index a2a7d92d6a961a80d994bb56d49ba7862d67f3aa..44db5d802aee9e32893cc5ccfaa6e07d73e28c12 100644 (file)
@@ -18088,9 +18088,9 @@ virDomainDefFormatInternal(virDomainDefPtr def,
     if ((def->mem.hard_limit &&
          def->mem.hard_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) ||
         (def->mem.soft_limit &&
-         def->mem.hard_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) ||
+         def->mem.soft_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) ||
         (def->mem.swap_hard_limit &&
-         def->mem.hard_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) ||
+         def->mem.swap_hard_limit != VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) ||
         def->mem.min_guarantee) {
         virBufferAddLit(buf, "<memtune>\n");
         virBufferAdjustIndent(buf, 2);