struct virDomainListData data = { NULL, 0 };
virObjectRWLockRead(domlist);
- sa_assert(domlist->objs);
data.vms = g_new0(virDomainObj *, virHashSize(domlist->objs));
virHashForEach(domlist->objs, virDomainObjListCollectIterator, &data);
}
virObjectRWUnlock(domlist);
- sa_assert(*vms);
virDomainObjListFilter(vms, nvms, conn, filter, flags);
return 0;
struct virNWFilterBindingListData data = { NULL, 0 };
virObjectRWLockRead(domlist);
- sa_assert(domlist->objs);
data.bindings = g_new0(virNWFilterBindingObj *, virHashSize(domlist->objs));
virHashForEach(domlist->objs, virNWFilterBindingObjListCollectIterator, &data);
}
if (flags & VIR_DOMAIN_MEM_CONFIG) {
- /* Help clang 2.8 decipher the logic flow. */
- sa_assert(persistentDef);
virDomainDefSetMemoryTotal(persistentDef, newmem);
if (persistentDef->mem.cur_balloon > newmem)
persistentDef->mem.cur_balloon = newmem;
}
if (flags & VIR_DOMAIN_MEM_CONFIG) {
- sa_assert(persistentDef);
persistentDef->mem.cur_balloon = newmem;
ret = virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir);
goto endjob;
if (flags & VIR_DOMAIN_AFFECT_LIVE)
targetDef = vm->def;
- /* Make sure coverity knows targetDef is valid at this point. */
- sa_assert(targetDef);
-
pcpumap = virBitmapNewData(cpumap, maplen);
if (!pcpumap)
goto endjob;
if (flags & VIR_DOMAIN_AFFECT_LIVE)
targetDef = vm->def;
- /* Make sure coverity knows targetDef is valid at this point. */
- sa_assert(targetDef);
-
hostcpus = virBitmapNew(libxl_get_max_cpus(cfg->ctx));
virBitmapSetAll(hostcpus);
msg.msg_controllen = sizeof(control);
cmsg = CMSG_FIRSTHDR(&msg);
- /* Some static analyzers, like clang 2.6-0.6.pre2, fail to see
- that our use of CMSG_FIRSTHDR will not return NULL. */
- sa_assert(cmsg);
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
cmsg->cmsg_level = SOL_SOCKET;
cmsg->cmsg_type = SCM_RIGHTS;
*eol = '\n';
}
}
- filter_next = NULL; /* silence false coverity warning */
if (got > 0 &&
buf[got - 1] == '\n') {
reprocess:
for (i = 0; i < srv->nclients; i++) {
- /* Coverity 5.3.0 couldn't see that srv->clients is non-NULL
- * if srv->nclients is non-zero. */
- sa_assert(srv->clients);
-
client = srv->clients[i];
virObjectLock(client);
if (virNetServerClientWantCloseLocked(client))
buf = cmd->errbuf;
len = &errlen;
}
- /* Silence a false positive from clang. */
- sa_assert(buf);
-
done = read(fds[i].fd, data, sizeof(data));
if (done < 0) {
if (errno != EINTR &&
}
while ((ctxt->cur < ctxt->end) && (CUR != ']')) {
- /* Tell Clang that when execution reaches this point
- "lst" is guaranteed to be non-NULL. This stops it
- from issuing an invalid NULL-dereference warning about
- "prev = lst; while (prev->next..." below. */
- sa_assert(lst);
-
if (CUR != ',') {
virConfError(ctxt, VIR_ERR_CONF_SYNTAX,
_("expecting a separator in list"));
int rc = -1;
char *field = strchr(param->field, '_');
- sa_assert(field);
field++;
path = g_strdup_printf("%s/%s", SYSFS_MEMORY_SHARED_PATH, field);
virTypedParameterPtr param = ¶ms[i];
char *field = strchr(param->field, '_');
- sa_assert(field);
field++;
path = g_strdup_printf("%s/%s", SYSFS_MEMORY_SHARED_PATH, field);
return NULL;
} else if (objectSize <= parentSize ||
parentSize != (parent ? parent->objectSize : 0)) {
- sa_assert(parent);
virReportInvalidArg(objectSize,
_("object size %zu of %s is not larger than parent class %zu"),
objectSize, name, parent->objectSize);
return g_strdup(hostname);
}
- /* Tell static analyzers about getaddrinfo semantics. */
- sa_assert(info);
-
if (info->ai_canonname == NULL ||
STRPREFIX(info->ai_canonname, "localhost"))
/* in this case, we tried to canonicalize and we ended up back with
goto cleanup;
}
- sa_assert(outbuf);
if (*outbuf) {
puts("output buffer is not an allocated empty string");
goto cleanup;
opt->help = "string": straight replacement of name
opt->help = "string=value": treat boolean flag as
alias of option and its default value */
- sa_assert(!alias);
alias = g_strdup(opt->help);
name = alias;
if ((value = strchr(name, '='))) {