qemu: silence coverity false positives

Coverity gets confused by our logic.  Add some hints to silence
false positives.

* src/qemu/qemu_driver.c (qemudDomainGetVcpuPinInfo): Add hint.
(qemuDomainGetMemoryParameters): Likewise.
This commit is contained in:
Eric Blake 2011-08-02 16:45:23 -06:00
parent c86827a243
commit f768b4c3e9

View 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);