]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: silence coverity false positives
authorEric Blake <eblake@redhat.com>
Tue, 2 Aug 2011 22:45:23 +0000 (16:45 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 2 Aug 2011 22:45:23 +0000 (16:45 -0600)
Coverity gets confused by our logic.  Add some hints to silence
false positives.

* src/qemu/qemu_driver.c (qemudDomainGetVcpuPinInfo): Add hint.
(qemuDomainGetMemoryParameters): Likewise.

src/qemu/qemu_driver.c

index 2044e23f8f9cc572988d24d0a1da636481a79e3c..ce19be78e9259b23e3c701c2c0beccd22125b8b5 100644 (file)
@@ -3432,6 +3432,9 @@ qemudDomainGetVcpuPinInfo(virDomainPtr dom,
             goto cleanup;
     }
 
+    /* Coverity didn't realize that targetDef must be set if we got here.  */
+    sa_assert(targetDef);
+
     if (nodeGetInfo(dom->conn, &nodeinfo) < 0)
         goto cleanup;
     hostcpus = VIR_NODEINFO_MAXCPUS(nodeinfo);
@@ -6139,6 +6142,9 @@ static int qemuDomainGetMemoryParameters(virDomainPtr dom,
         param->value.ul = 0;
         param->type = VIR_TYPED_PARAM_ULLONG;
 
+        /* Coverity does not realize that if we get here, group is set.  */
+        sa_assert(group);
+
         switch (i) {
         case 0: /* fill memory hard limit here */
             rc = virCgroupGetMemoryHardLimit(group, &val);