pae = 1;
else
nonpae = 1;
- }
- else if (STRPREFIX(&token[subs[2].rm_so], "x86_64")) {
+ } else if (STRPREFIX(&token[subs[2].rm_so], "x86_64")) {
arch = VIR_ARCH_X86_64;
- }
- else if (STRPREFIX(&token[subs[2].rm_so], "ia64")) {
+ } else if (STRPREFIX(&token[subs[2].rm_so], "ia64")) {
arch = VIR_ARCH_ITANIUM;
if (subs[3].rm_so != -1 &&
STRPREFIX(&token[subs[3].rm_so], "be"))
ia64_be = 1;
- }
- else if (STRPREFIX(&token[subs[2].rm_so], "powerpc64")) {
+ } else if (STRPREFIX(&token[subs[2].rm_so], "powerpc64")) {
arch = VIR_ARCH_PPC64;
} else if (STRPREFIX(&token[subs[2].rm_so], "armv7l")) {
arch = VIR_ARCH_ARMV7L;
if (def->os.nBootDevs == 0) {
bootorder[0] = 'c';
bootorder[1] = '\0';
- }
- else {
+ } else {
bootorder[def->os.nBootDevs] = '\0';
}
if (VIR_STRDUP(b_info->u.hvm.boot, bootorder) < 0)
ipt->state = VIR_VCPU_RUNNING;
if (op.u.getvcpuinfo.blocked)
ipt->state = VIR_VCPU_BLOCKED;
- } else
+ } else {
ipt->state = VIR_VCPU_OFFLINE;
+ }
ipt->cpuTime = op.u.getvcpuinfo.cpu_time;
ipt->cpu = op.u.getvcpuinfo.online ? (int)op.u.getvcpuinfo.cpu : -1;
ipt->state = VIR_VCPU_RUNNING;
if (op.u.getvcpuinfod5.blocked)
ipt->state = VIR_VCPU_BLOCKED;
- } else
+ } else {
ipt->state = VIR_VCPU_OFFLINE;
+ }
ipt->cpuTime = op.u.getvcpuinfod5.cpu_time;
ipt->cpu = op.u.getvcpuinfod5.online ? (int)op.u.getvcpuinfod5.cpu : -1;
subs[1].rm_eo-subs[1].rm_so,
sizeof(hvm_type)) == NULL)
goto no_memory;
- } else if (regexec(&flags_pae_rec, line, 0, NULL, 0) == 0)
+ } else if (regexec(&flags_pae_rec, line, 0, NULL, 0) == 0) {
host_pae = 1;
+ }
}
}
pae = 1;
else
nonpae = 1;
- }
- else if (STRPREFIX(&token[subs[2].rm_so], "x86_64")) {
+ } else if (STRPREFIX(&token[subs[2].rm_so], "x86_64")) {
arch = VIR_ARCH_X86_64;
- }
- else if (STRPREFIX(&token[subs[2].rm_so], "ia64")) {
+ } else if (STRPREFIX(&token[subs[2].rm_so], "ia64")) {
arch = VIR_ARCH_ITANIUM;
if (subs[3].rm_so != -1 &&
STRPREFIX(&token[subs[3].rm_so], "be"))
ia64_be = 1;
- }
- else if (STRPREFIX(&token[subs[2].rm_so], "powerpc64")) {
+ } else if (STRPREFIX(&token[subs[2].rm_so], "powerpc64")) {
arch = VIR_ARCH_PPC64;
} else {
/* XXX surely no other Xen archs exist. Arrrrrrrrrm */
if (value) {
if (virStrToLong_i(value, NULL, 10, &priv->xendConfigVersion) < 0)
goto cleanup;
- } else {
+ } else {
/* Xen prior to 3.0.3 did not have the xend_config_format
field, and is implicitly version 1. */
priv->xendConfigVersion = XEND_CONFIG_VERSION_3_0_2;
if (xenDaemonOpen_unix(conn, conn->uri->path) < 0 ||
xend_detect_config_version(conn) == -1)
goto failed;
- }
- else if (STRCASEEQ(conn->uri->scheme, "xen")) {
+ } else if (STRCASEEQ(conn->uri->scheme, "xen")) {
/*
* try first to open the unix socket
*/
ret = xend_op(conn, minidef->name, "op", "device_configure",
"config", xendev, "dev", ref, NULL);
VIR_FREE(xendev);
- }
- else {
+ } else {
ret = xend_op(conn, minidef->name, "op", "device_destroy",
"type", class, "dev", ref, "force", "0", "rm_cfg", "1",
NULL);
if (uriptr->port)
snprintf(port, sizeof(port), "%d", uriptr->port);
virURIFree(uriptr);
- }
- else if ((p = strrchr(uri, ':')) != NULL) { /* "hostname:port" */
+ } else if ((p = strrchr(uri, ':')) != NULL) { /* "hostname:port" */
int port_nr, n;
if (virStrToLong_i(p+1, NULL, 10, &port_nr) < 0) {
if (VIR_STRDUP(hostname, uri) < 0)
return -1;
hostname[n] = '\0';
- }
- else { /* "hostname" (or IP address) */
+ } else { /* "hostname" (or IP address) */
if (VIR_STRDUP(hostname, uri) < 0)
return -1;
}
const char *actual;
/* Security check: The path must correspond to a block device. */
- if (minidef->id > 0)
+ if (minidef->id > 0) {
root = sexpr_get(conn, "/xend/domain/%d?detail=1",
minidef->id);
- else if (minidef->id < 0)
+ } else if (minidef->id < 0) {
root = sexpr_get(conn, "/xend/domain/%s?detail=1",
minidef->name);
- else {
+ } else {
/* This call always fails for dom0. */
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domainBlockPeek is not supported for dom0"));
if (xen_session_get_this_host(session, &host, session)) {
xen_host_get_resident_vms(session, &result, host);
xen_host_free(host);
- } else
+ } else {
xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, NULL);
+ }
if (result != NULL) {
for (i = 0; (i < (result->size)) && (i < maxids); i++) {
xen_vm_get_domid(session, &t0, result->contents[i]);
domP->id = record->domid;
}
xen_vm_record_free(record);
- }
- else
+ } else {
xenapiSessionErrorHandler(conn, VIR_ERR_NO_DOMAIN, NULL);
+ }
xen_vm_free(vm);
- } else
+ } else {
xenapiSessionErrorHandler(conn, VIR_ERR_NO_DOMAIN, NULL);
+ }
return domP;
}
ignore_value(VIR_STRDUP(ostype,
STREQ(boot_policy, "BIOS order") ? "hvm" : "xen"));
VIR_FREE(boot_policy);
- } else
+ } else {
xenapiSessionErrorHandler(dom->conn, VIR_ERR_NO_DOMAIN, NULL);
+ }
cleanup:
if (vms)
if (xenConfigGetBool(conf, "hpet", &val, -1) < 0)
return -1;
- else if (val != -1) {
+ if (val != -1) {
virDomainTimerDefPtr timer;
if (VIR_ALLOC_N(def->clock.timers, 1) < 0 ||
if (!hvm) {
if (net->model != NULL)
virBufferAsprintf(&buf, ",model=%s", net->model);
- }
- else {
+ } else {
if (net->model != NULL && STREQ(net->model, "netfront")) {
virBufferAddLit(&buf, ",type=netfront");
- }
- else {
+ } else {
if (net->model != NULL)
virBufferAsprintf(&buf, ",model=%s", net->model);
_("unknown lifecycle type %s"), tmp);
goto error;
}
- } else
+ } else {
def->onPoweroff = VIR_DOMAIN_LIFECYCLE_DESTROY;
+ }
tmp = sexpr_node(root, "domain/on_reboot");
if (tmp != NULL) {
_("unknown lifecycle type %s"), tmp);
goto error;
}
- } else
+ } else {
def->onReboot = VIR_DOMAIN_LIFECYCLE_RESTART;
+ }
tmp = sexpr_node(root, "domain/on_crash");
if (tmp != NULL) {
_("unknown lifecycle type %s"), tmp);
goto error;
}
- } else
+ } else {
def->onCrash = VIR_DOMAIN_LIFECYCLE_DESTROY;
+ }
if (hvm) {
if (sexpr_int(root, "domain/image/hvm/acpi"))
if (!hvm) {
if (def->model != NULL)
virBufferEscapeSexpr(buf, "(model '%s')", def->model);
- }
- else {
+ } else {
if (def->model != NULL && STREQ(def->model, "netfront")) {
virBufferAddLit(buf, "(type netfront)");
- }
- else {
+ } else {
if (def->model != NULL) {
virBufferEscapeSexpr(buf, "(model '%s')", def->model);
}
}
}
virBufferAddLit(&buf, "))");
- }
- else {
+ } else {
virBufferAddLit(&buf, "(serial ");
if (xenFormatSxprChr(def->serials[0], &buf) < 0)
goto error;