]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuBuildNumaArgStr: Discard def->cpu check
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 23 Sep 2014 11:08:39 +0000 (13:08 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 23 Sep 2014 11:08:39 +0000 (13:08 +0200)
In the function at one place we check if def->cpu is NULL prior
to accessing def->cpu->ncells. Then, later in the code,
def->cpu->ncells is accessed directly, without the check. This
makes coverity unhappy, because the first check makes it think
def->cpu can be NULL. However, the function is not called if
def->cpu is NULL. Therefore, remove the first check and hopefully
make coverity cheer again.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_command.c

index d470b1b3367b5e017b839b3df8ac6d5e0c2f6e22..65864d2a44f1fb0138bad8f19e43ae58648d5806 100644 (file)
@@ -6594,7 +6594,7 @@ qemuBuildNumaArgStr(virQEMUDriverConfigPtr cfg,
             continue;
         }
 
-        if (def->cpu && def->cpu->ncells) {
+        if (def->cpu->ncells) {
             /* Fortunately, we allow only guest NUMA nodes to be continuous
              * starting from zero. */
             pos = def->cpu->ncells - 1;