att_datatypes = att[idx].datatype;
- while (datatype <= DATATYPE_LAST && found == 0 && rc == 0) {
+ while (datatype <= DATATYPE_LAST && !found && rc == 0) {
if ((att_datatypes & datatype)) {
att_datatypes ^= datatype;
matchShown = MATCH_NO;
} else if (matchShown == MATCH_YES) {
virBufferAddLit(buf, "/>\n");
- typeShown = 0;
+ typeShown = false;
matchShown = MATCH_NONE;
continue;
}
} else {
if (matchShown == MATCH_NO) {
virBufferAddLit(buf, "/>\n");
- typeShown = 0;
+ typeShown = false;
matchShown = MATCH_NONE;
continue;
}
virStoragePoolObjIsAutostart(virStoragePoolObjPtr obj)
{
if (!obj->configFile)
- return 0;
+ return false;
return obj->autostart;
}
if (!(lxc_driver->config = cfg = virLXCDriverConfigNew()))
goto cleanup;
- cfg->log_libvirtd = 0; /* by default log to container logfile */
+ cfg->log_libvirtd = false; /* by default log to container logfile */
cfg->have_netns = lxcCheckNetNsSupport();
/* Call function to load lxc driver configuration information */
void *entry;
if (threadKey == NULL)
- return 0;
+ return false;
virNWFilterSnoopActiveLock();
/* receiving garbage on first sync is regular situation */
if (msg && msg->sync && msg->first) {
VIR_DEBUG("Received garbage on sync");
- msg->finished = 1;
+ msg->finished = true;
return 0;
}
}
}
msg->rxObject = obj;
- msg->finished = 1;
+ msg->finished = true;
obj = NULL;
} else {
/* we are out of sync */
/* If IO process resulted in an error & we have a message,
* then wakeup that waiter */
if (agent->msg && !agent->msg->finished) {
- agent->msg->finished = 1;
+ agent->msg->finished = true;
virCondSignal(&agent->notify);
}
}
/* If there is somebody waiting for a message
* wake him up. No message will arrive anyway. */
if (agent->msg && !agent->msg->finished) {
- agent->msg->finished = 1;
+ agent->msg->finished = true;
virCondSignal(&agent->notify);
}
}
agent->await_event = QEMU_AGENT_EVENT_NONE;
/* somebody waiting for this event, wake him up. */
if (agent->msg && !agent->msg->finished) {
- agent->msg->finished = 1;
+ agent->msg->finished = true;
virCondSignal(&agent->notify);
}
}
/* If IO process resulted in an error & we have a message,
* then wakeup that waiter */
if (mon->msg && !mon->msg->finished) {
- mon->msg->finished = 1;
+ mon->msg->finished = true;
virCondSignal(&mon->notify);
}
}
else
virResetLastError();
}
- mon->msg->finished = 1;
+ mon->msg->finished = true;
virCondSignal(&mon->notify);
}
# endif /* ! LIBVIRTD */
#endif /* ! WITH_IP */
struct daemonConfig *config;
- bool privileged = geteuid() == 0 ? true : false;
+ bool privileged = geteuid() == 0;
bool implicit_conf = false;
char *run_dir = NULL;
mode_t old_umask;
#ifdef WITH_IP
# ifdef LIBVIRTD
- data->listen_tls = 1; /* Only honoured if --listen is set */
+ data->listen_tls = true; /* Only honoured if --listen is set */
# else /* ! LIBVIRTD */
- data->listen_tls = 0; /* Always honoured, --listen doesn't exist. */
+ data->listen_tls = false; /* Always honoured, --listen doesn't exist. */
# endif /* ! LIBVIRTD */
- data->listen_tcp = 0;
+ data->listen_tcp = false;
data->tls_port = g_strdup(LIBVIRTD_TLS_PORT);
data->tcp_port = g_strdup(LIBVIRTD_TCP_PORT);
data->max_client_requests = 5;
data->audit_level = 1;
- data->audit_logging = 0;
+ data->audit_logging = false;
data->keepalive_interval = 5;
data->keepalive_count = 5;
goto failed;
priv->tls = virNetTLSContextNewClientPath(pkipath,
- geteuid() != 0 ? true : false,
+ geteuid() != 0,
tls_priority,
sanity, verify);
if (!priv->tls)
{
int ret = -1;
virNetTLSContextPtr ctxt = NULL;
- bool privileged = geteuid() == 0 ? true : false;
+ bool privileged = geteuid() == 0;
ctxt = virNetServerGetTLSContext(srv);
if (!ctxt) {
bool virNetlinkEventServiceIsRunning(unsigned int protocol G_GNUC_UNUSED)
{
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported));
- return 0;
+ return false;
}
int virNetlinkEventServiceLocalPid(unsigned int protocol G_GNUC_UNUSED)
VIR_DEBUG("t=%llu, limit=%llu", t, var->limit_t);
if (t > var->limit_t)
- return 0; /* ends the while loop */
+ return false; /* ends the while loop */
/* Compute next wait time. Cap at VIR_TIME_BACKOFF_CAP
* to avoid long useless sleeps. */
VIR_DEBUG("sleeping for %llu ms", next);
g_usleep(next * 1000);
- return 1;
+ return true;
}
uri->params[uri->paramsCount].name = pname;
uri->params[uri->paramsCount].value = pvalue;
- uri->params[uri->paramsCount].ignore = 0;
+ uri->params[uri->paramsCount].ignore = false;
uri->paramsCount++;
return 0;
return rc;
if (STRCASEEQ(string, "true")) {
- *boolean_ = 1;
+ *boolean_ = true;
} else if (STRCASEEQ(string, "false")) {
- *boolean_ = 0;
+ *boolean_ = false;
} else {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Config entry '%s' must represent a boolean value "