mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
maint: avoid comparisons to bool constants
HACKING already mentions that comparisons against literal 'true' are unsafe; for consistency, also shorten comparisons against 'false'. * src/conf/domain_conf.c (virDomainNetDefParseXML): Simplify. * src/nwfilter/nwfilter_gentech_driver.c (virNWFilterDomainFWUpdateCB): Likewise. * tools/virsh.c (cmdVolDownload, vshCommandRun, vshPrintExtra): Likewise.
This commit is contained in:
parent
5d09c31495
commit
f84fe150e1
@ -2602,7 +2602,7 @@ virDomainNetDefParseXML(virCapsPtr caps,
|
|||||||
xmlStrEqual(cur->name, BAD_CAST "source")) {
|
xmlStrEqual(cur->name, BAD_CAST "source")) {
|
||||||
dev = virXMLPropString(cur, "dev");
|
dev = virXMLPropString(cur, "dev");
|
||||||
mode = virXMLPropString(cur, "mode");
|
mode = virXMLPropString(cur, "mode");
|
||||||
} else if ((virtPortParsed == false) &&
|
} else if (!virtPortParsed &&
|
||||||
(def->type == VIR_DOMAIN_NET_TYPE_DIRECT) &&
|
(def->type == VIR_DOMAIN_NET_TYPE_DIRECT) &&
|
||||||
xmlStrEqual(cur->name, BAD_CAST "virtualport")) {
|
xmlStrEqual(cur->name, BAD_CAST "virtualport")) {
|
||||||
if (virVirtualPortProfileParamsParseXML(cur, &virtPort))
|
if (virVirtualPortProfileParamsParseXML(cur, &virtPort))
|
||||||
|
@ -1032,7 +1032,7 @@ virNWFilterDomainFWUpdateCB(void *payload,
|
|||||||
cb->err = virNWFilterUpdateInstantiateFilter(cb->conn,
|
cb->err = virNWFilterUpdateInstantiateFilter(cb->conn,
|
||||||
net,
|
net,
|
||||||
&skipIface);
|
&skipIface);
|
||||||
if (cb->err == 0 && skipIface == true) {
|
if (cb->err == 0 && skipIface) {
|
||||||
/* filter tree unchanged -- no update needed */
|
/* filter tree unchanged -- no update needed */
|
||||||
cb->err = virHashAddEntry(cb->skipInterfaces,
|
cb->err = virHashAddEntry(cb->skipInterfaces,
|
||||||
net->ifname,
|
net->ifname,
|
||||||
|
@ -7318,7 +7318,7 @@ cmdVolDownload (vshControl *ctl, const vshCmd *cmd)
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
if (ret == false && created)
|
if (!ret && created)
|
||||||
unlink(file);
|
unlink(file);
|
||||||
if (vol)
|
if (vol)
|
||||||
virStorageVolFree(vol);
|
virStorageVolFree(vol);
|
||||||
@ -11697,11 +11697,11 @@ vshCommandRun(vshControl *ctl, const vshCmd *cmd)
|
|||||||
if (enable_timing)
|
if (enable_timing)
|
||||||
GETTIMEOFDAY(&after);
|
GETTIMEOFDAY(&after);
|
||||||
|
|
||||||
if (ret == false)
|
if (!ret)
|
||||||
virshReportError(ctl);
|
virshReportError(ctl);
|
||||||
|
|
||||||
/* try to automatically catch disconnections */
|
/* try to automatically catch disconnections */
|
||||||
if ((ret == false) &&
|
if (!ret &&
|
||||||
((disconnected != 0) ||
|
((disconnected != 0) ||
|
||||||
((last_error != NULL) &&
|
((last_error != NULL) &&
|
||||||
(((last_error->code == VIR_ERR_SYSTEM_ERROR) &&
|
(((last_error->code == VIR_ERR_SYSTEM_ERROR) &&
|
||||||
@ -12105,7 +12105,7 @@ vshPrintExtra(vshControl *ctl, const char *format, ...)
|
|||||||
va_list ap;
|
va_list ap;
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
if (ctl && ctl->quiet == true)
|
if (ctl && ctl->quiet)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user