None of them are currently needed to pass our upstream CI, most were
either for ancient clang versions or coverity for silencing false
positives.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/conf/virdomainobjlist.c | 2 --
src/conf/virnwfilterbindingobjlist.c | 1 -
src/libxl/libxl_driver.c | 9 ---------
src/qemu/qemu_monitor.c | 3 ---
src/qemu/qemu_process.c | 1 -
src/rpc/virnetserver.c | 4 ----
src/util/vircommand.c | 3 ---
src/util/virconf.c | 6 ------
src/util/virhostmem.c | 2 --
src/util/virobject.c | 1 -
src/util/virutil.c | 3 ---
tests/commandtest.c | 1 -
tools/vsh.c | 1 -
13 files changed, 37 deletions(-)
diff --git a/src/conf/virdomainobjlist.c b/src/conf/virdomainobjlist.c
index e1d455eefe..5f9fd9aabc 100644
--- a/src/conf/virdomainobjlist.c
+++ b/src/conf/virdomainobjlist.c
@@ -980,7 +980,6 @@ virDomainObjListCollect(virDomainObjList *domlist,
struct virDomainListData data = { NULL, 0 };
virObjectRWLockRead(domlist);
- sa_assert(domlist->objs);
data.vms = g_new0(virDomainObj *, virHashSize(domlist->objs));
virHashForEach(domlist->objs, virDomainObjListCollectIterator, &data);
@@ -1040,7 +1039,6 @@ virDomainObjListConvert(virDomainObjList *domlist,
}
virObjectRWUnlock(domlist);
- sa_assert(*vms);
virDomainObjListFilter(vms, nvms, conn, filter, flags);
return 0;
diff --git a/src/conf/virnwfilterbindingobjlist.c b/src/conf/virnwfilterbindingobjlist.c
index fe97f2b3df..1f19e27eb0 100644
--- a/src/conf/virnwfilterbindingobjlist.c
+++ b/src/conf/virnwfilterbindingobjlist.c
@@ -432,7 +432,6 @@ virNWFilterBindingObjListCollect(virNWFilterBindingObjList *domlist,
struct virNWFilterBindingListData data = { NULL, 0 };
virObjectRWLockRead(domlist);
- sa_assert(domlist->objs);
data.bindings = g_new0(virNWFilterBindingObj *, virHashSize(domlist->objs));
virHashForEach(domlist->objs, virNWFilterBindingObjListCollectIterator,
&data);
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index d54cd41785..7b89e7c224 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -1666,8 +1666,6 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
}
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;
@@ -1702,7 +1700,6 @@ libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
}
if (flags & VIR_DOMAIN_MEM_CONFIG) {
- sa_assert(persistentDef);
persistentDef->mem.cur_balloon = newmem;
ret = virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir);
goto endjob;
@@ -2476,9 +2473,6 @@ libxlDomainPinVcpuFlags(virDomainPtr dom, unsigned int vcpu,
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;
@@ -2557,9 +2551,6 @@ libxlDomainGetVcpuPinInfo(virDomainPtr dom, int ncpumaps,
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);
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 1e6f892e08..8f35b4240f 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -398,9 +398,6 @@ qemuMonitorIOWriteWithFD(qemuMonitor *mon,
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;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index cf422656ff..a5f3114380 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2089,7 +2089,6 @@ qemuProcessReadLog(qemuDomainLogContext *logCtxt,
*eol = '\n';
}
}
- filter_next = NULL; /* silence false coverity warning */
if (got > 0 &&
buf[got - 1] == '\n') {
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index 42e06fcb59..cfb65f8b5f 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -937,10 +937,6 @@ virNetServerProcessClients(virNetServer *srv)
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))
diff --git a/src/util/vircommand.c b/src/util/vircommand.c
index 7abb2e288f..6e01e4cb62 100644
--- a/src/util/vircommand.c
+++ b/src/util/vircommand.c
@@ -2263,9 +2263,6 @@ virCommandProcessIO(virCommand *cmd)
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 &&
diff --git a/src/util/virconf.c b/src/util/virconf.c
index 15a65ec394..07ecfc7b57 100644
--- a/src/util/virconf.c
+++ b/src/util/virconf.c
@@ -472,12 +472,6 @@ virConfParseValue(virConfParserCtxt *ctxt)
}
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"));
diff --git a/src/util/virhostmem.c b/src/util/virhostmem.c
index ae42978ed2..8aa675cb4f 100644
--- a/src/util/virhostmem.c
+++ b/src/util/virhostmem.c
@@ -313,7 +313,6 @@ virHostMemSetParameterValue(virTypedParameterPtr param)
int rc = -1;
char *field = strchr(param->field, '_');
- sa_assert(field);
field++;
path = g_strdup_printf("%s/%s", SYSFS_MEMORY_SHARED_PATH, field);
@@ -338,7 +337,6 @@ virHostMemParametersAreAllSupported(virTypedParameterPtr params,
virTypedParameterPtr param = ¶ms[i];
char *field = strchr(param->field, '_');
- sa_assert(field);
field++;
path = g_strdup_printf("%s/%s", SYSFS_MEMORY_SHARED_PATH, field);
diff --git a/src/util/virobject.c b/src/util/virobject.c
index 7173b9136f..3412985b79 100644
--- a/src/util/virobject.c
+++ b/src/util/virobject.c
@@ -182,7 +182,6 @@ virClassNew(virClass *parent,
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);
diff --git a/src/util/virutil.c b/src/util/virutil.c
index 3f49a469e5..311cbbf93a 100644
--- a/src/util/virutil.c
+++ b/src/util/virutil.c
@@ -512,9 +512,6 @@ virGetHostnameImpl(bool quiet)
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
diff --git a/tests/commandtest.c b/tests/commandtest.c
index 57c7db67d8..5267e1bf1c 100644
--- a/tests/commandtest.c
+++ b/tests/commandtest.c
@@ -611,7 +611,6 @@ static int test17(const void *unused G_GNUC_UNUSED)
goto cleanup;
}
- sa_assert(outbuf);
if (*outbuf) {
puts("output buffer is not an allocated empty string");
goto cleanup;
diff --git a/tools/vsh.c b/tools/vsh.c
index ebaf17f326..123284c636 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -449,7 +449,6 @@ vshCmddefGetOption(vshControl *ctl, const vshCmdDef *cmd, const char
*name,
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, '='))) {
--
2.31.1