xmlStrEqual(cur->name, BAD_CAST "source")) {
if (def->type == VIR_DOMAIN_FS_TYPE_MOUNT ||
- def->type == VIR_DOMAIN_FS_TYPE_BIND)
+ def->type == VIR_DOMAIN_FS_TYPE_BIND) {
source = virXMLPropString(cur, "dir");
- else if (def->type == VIR_DOMAIN_FS_TYPE_FILE)
+ } else if (def->type == VIR_DOMAIN_FS_TYPE_FILE) {
source = virXMLPropString(cur, "file");
- else if (def->type == VIR_DOMAIN_FS_TYPE_BLOCK)
+ } else if (def->type == VIR_DOMAIN_FS_TYPE_BLOCK) {
source = virXMLPropString(cur, "dev");
- else if (def->type == VIR_DOMAIN_FS_TYPE_TEMPLATE)
+ } else if (def->type == VIR_DOMAIN_FS_TYPE_TEMPLATE) {
source = virXMLPropString(cur, "name");
- else if (def->type == VIR_DOMAIN_FS_TYPE_RAM) {
+ } else if (def->type == VIR_DOMAIN_FS_TYPE_RAM) {
usage = virXMLPropString(cur, "usage");
units = virXMLPropString(cur, "units");
}
def->data.vhostuser->data.nix.path = vhostuser_path;
vhostuser_path = NULL;
- if (STREQ(vhostuser_mode, "server"))
+ if (STREQ(vhostuser_mode, "server")) {
def->data.vhostuser->data.nix.listen = true;
- else if (STREQ(vhostuser_mode, "client"))
+ } else if (STREQ(vhostuser_mode, "client")) {
def->data.vhostuser->data.nix.listen = false;
- else {
+ } else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Wrong <source> 'mode' attribute "
"specified with <interface "
}
action = virXMLPropString(node, "action");
- if (action == NULL)
+ if (action == NULL) {
def->action = VIR_DOMAIN_WATCHDOG_ACTION_RESET;
- else {
+ } else {
def->action = virDomainWatchdogActionTypeFromString(action);
if (def->action < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
"%s", _("malformed <sysinfo> uuid element"));
goto error;
}
- if (uuid_generated)
+ if (uuid_generated) {
memcpy(domUUID, uuidbuf, VIR_UUID_BUFLEN);
- else if (memcmp(domUUID, uuidbuf, VIR_UUID_BUFLEN) != 0) {
+ } else if (memcmp(domUUID, uuidbuf, VIR_UUID_BUFLEN) != 0) {
virReportError(VIR_ERR_XML_DETAIL, "%s",
_("UUID mismatch between <uuid> and "
"<sysinfo>"));
allow = virXMLPropString(node, "allow");
if (allow) {
- if (STREQ(allow, "yes"))
+ if (STREQ(allow, "yes")) {
def->allow = true;
- else if (STREQ(allow, "no"))
+ } else if (STREQ(allow, "no")) {
def->allow = false;
- else {
+ } else {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Invalid allow value, either 'yes' or 'no'"));
goto error;
char *tmp;
tmp = virXPathString("string(./start/@mode)", ctxt);
- if (tmp == NULL)
+ if (tmp == NULL) {
def->startmode = VIR_INTERFACE_START_UNSPECIFIED;
- else if (STREQ(tmp, "onboot"))
+ } else if (STREQ(tmp, "onboot")) {
def->startmode = VIR_INTERFACE_START_ONBOOT;
- else if (STREQ(tmp, "hotplug"))
+ } else if (STREQ(tmp, "hotplug")) {
def->startmode = VIR_INTERFACE_START_HOTPLUG;
- else if (STREQ(tmp, "none"))
+ } else if (STREQ(tmp, "none")) {
def->startmode = VIR_INTERFACE_START_NONE;
- else {
+ } else {
virReportError(VIR_ERR_XML_ERROR,
_("unknown interface startmode %s"), tmp);
VIR_FREE(tmp);
tmp = virXPathString("string(./@mode)", ctxt);
if (tmp == NULL)
return VIR_INTERFACE_BOND_NONE;
- if (STREQ(tmp, "balance-rr"))
+ if (STREQ(tmp, "balance-rr")) {
ret = VIR_INTERFACE_BOND_BALRR;
- else if (STREQ(tmp, "active-backup"))
+ } else if (STREQ(tmp, "active-backup")) {
ret = VIR_INTERFACE_BOND_ABACKUP;
- else if (STREQ(tmp, "balance-xor"))
+ } else if (STREQ(tmp, "balance-xor")) {
ret = VIR_INTERFACE_BOND_BALXOR;
- else if (STREQ(tmp, "broadcast"))
+ } else if (STREQ(tmp, "broadcast")) {
ret = VIR_INTERFACE_BOND_BCAST;
- else if (STREQ(tmp, "802.3ad"))
+ } else if (STREQ(tmp, "802.3ad")) {
ret = VIR_INTERFACE_BOND_8023AD;
- else if (STREQ(tmp, "balance-tlb"))
+ } else if (STREQ(tmp, "balance-tlb")) {
ret = VIR_INTERFACE_BOND_BALTLB;
- else if (STREQ(tmp, "balance-alb"))
+ } else if (STREQ(tmp, "balance-alb")) {
ret = VIR_INTERFACE_BOND_BALALB;
- else {
+ } else {
virReportError(VIR_ERR_XML_ERROR,
_("unknown bonding mode %s"), tmp);
ret = -1;
tmp = virXPathString("string(./miimon/@carrier)", ctxt);
if (tmp == NULL)
return VIR_INTERFACE_BOND_MII_NONE;
- if (STREQ(tmp, "ioctl"))
+ if (STREQ(tmp, "ioctl")) {
ret = VIR_INTERFACE_BOND_MII_IOCTL;
- else if (STREQ(tmp, "netif"))
+ } else if (STREQ(tmp, "netif")) {
ret = VIR_INTERFACE_BOND_MII_NETIF;
- else {
+ } else {
virReportError(VIR_ERR_XML_ERROR,
_("unknown mii bonding carrier %s"), tmp);
ret = -1;
tmp = virXPathString("string(./arpmon/@validate)", ctxt);
if (tmp == NULL)
return VIR_INTERFACE_BOND_ARP_NONE;
- if (STREQ(tmp, "active"))
+ if (STREQ(tmp, "active")) {
ret = VIR_INTERFACE_BOND_ARP_ACTIVE;
- else if (STREQ(tmp, "backup"))
+ } else if (STREQ(tmp, "backup")) {
ret = VIR_INTERFACE_BOND_ARP_BACKUP;
- else if (STREQ(tmp, "all"))
+ } else if (STREQ(tmp, "all")) {
ret = VIR_INTERFACE_BOND_ARP_ALL;
- else {
+ } else {
virReportError(VIR_ERR_XML_ERROR,
_("unknown arp bonding validate %s"), tmp);
ret = -1;
/* Not much to do in the current version */
tmp = virXPathString("string(./@peerdns)", ctxt);
if (tmp) {
- if (STREQ(tmp, "yes"))
+ if (STREQ(tmp, "yes")) {
def->peerdns = 1;
- else if (STREQ(tmp, "no"))
+ } else if (STREQ(tmp, "no")) {
def->peerdns = 0;
- else {
+ } else {
virReportError(VIR_ERR_XML_ERROR,
_("unknown dhcp peerdns value %s"), tmp);
ret = -1;
}
VIR_FREE(tmp);
- } else
+ } else {
def->peerdns = -1;
+ }
ctxt->node = save;
return ret;
def->address = tmp;
if (tmp != NULL) {
ret = virXPathLong("string(./@prefix)", ctxt, &l);
- if (ret == 0)
+ if (ret == 0) {
def->prefix = (int) l;
- else if (ret == -2) {
+ } else if (ret == -2) {
virReportError(VIR_ERR_XML_ERROR,
"%s", _("Invalid ip address prefix value"));
return -1;
def->data.vlan.devname);
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</vlan>\n");
- } else
+ } else {
virBufferAddLit(buf, "/>\n");
+ }
return 0;
}
goto out;
}
- if (STREQ(type, "hotpluggable"))
+ if (STREQ(type, "hotpluggable")) {
data->storage.flags |= VIR_NODE_DEV_CAP_STORAGE_HOTPLUGGABLE;
- else if (STREQ(type, "removable")) {
+ } else if (STREQ(type, "removable")) {
xmlNodePtr orignode2;
data->storage.flags |= VIR_NODE_DEV_CAP_STORAGE_REMOVABLE;
item->u.u8 = uint_val;
found = true;
data.ui = uint_val;
- } else
+ } else {
rc = -1;
- } else
+ }
+ } else {
rc = -1;
+ }
break;
case DATATYPE_UINT16_HEX:
item->u.u16 = uint_val;
found = true;
data.ui = uint_val;
- } else
+ } else {
rc = -1;
- } else
+ }
+ } else {
rc = -1;
+ }
break;
case DATATYPE_UINT32_HEX:
item->u.u32 = uint_val;
found = true;
data.ui = uint_val;
- } else
+ } else {
rc = -1;
+ }
break;
case DATATYPE_IPADDR:
item->u.u8 = (uint8_t)uint_val;
found = true;
data.ui = uint_val;
- } else
+ } else {
rc = -1;
+ }
} else {
if (virSocketAddrParseIPv4(&ipaddr, prop) < 0) {
rc = -1;
item->u.u8 = (uint8_t)uint_val;
found = true;
data.ui = uint_val;
- } else
+ } else {
rc = -1;
+ }
} else {
if (virSocketAddrParseIPv6(&ipaddr, prop) < 0) {
rc = -1;
i++;
if (!virAttr[i].id)
break;
- } else
+ } else {
break;
+ }
}
}
virNWFilterEntryFree(entry);
goto cleanup;
}
- } else
+ } else {
virNWFilterEntryFree(entry);
+ }
}
curr = curr->next;
}
prop = virXPathString("string(./@ephemeral)", ctxt);
if (prop != NULL) {
- if (STREQ(prop, "yes"))
+ if (STREQ(prop, "yes")) {
def->ephemeral = true;
- else if (STREQ(prop, "no"))
+ } else if (STREQ(prop, "no")) {
def->ephemeral = false;
- else {
+ } else {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("invalid value of 'ephemeral'"));
goto cleanup;
prop = virXPathString("string(./@private)", ctxt);
if (prop != NULL) {
- if (STREQ(prop, "yes"))
+ if (STREQ(prop, "yes")) {
def->private = true;
- else if (STREQ(prop, "no"))
+ } else if (STREQ(prop, "no")) {
def->private = false;
- else {
+ } else {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("invalid value of 'private'"));
goto cleanup;
/*
* cpu_x86.c: CPU driver for CPUs with x86 compatible CPUID instruction
*
- * Copyright (C) 2009-2011, 2013 Red Hat, Inc.
+ * Copyright (C) 2009-2014 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
goto error;
}
- if (map->features == NULL)
+ if (map->features == NULL) {
map->features = feature;
- else {
+ } else {
feature->next = map->features;
map->features = feature;
}
goto error;
}
- if (map->models == NULL)
+ if (map->models == NULL) {
map->models = model;
- else {
+ } else {
model->next = map->models;
map->models = model;
}
cpu->type = VIR_CPU_TYPE_GUEST;
cpu->match = VIR_CPU_MATCH_EXACT;
- if (!cpus[0]->vendor)
+ if (!cpus[0]->vendor) {
outputVendor = false;
- else if (!(vendor = x86VendorFind(map, cpus[0]->vendor))) {
+ } else if (!(vendor = x86VendorFind(map, cpus[0]->vendor))) {
virReportError(VIR_ERR_OPERATION_FAILED,
_("Unknown CPU vendor %s"), cpus[0]->vendor);
goto error;
goto error;
}
- if (cpus[i]->vendor)
+ if (cpus[i]->vendor) {
vn = cpus[i]->vendor;
- else {
+ } else {
outputVendor = false;
if (model->vendor)
vn = model->vendor->name;
*/
for (i = 0; i < 25; i++) {
int signum = 0;
- if (i == 0)
+ if (i == 0) {
signum = SIGTERM;
- else if (i == 15) {
+ } else if (i == 15) {
signum = SIGKILL;
signame = "KILL";
}
/* Are we doing RA instead of radvd? */
if (DNSMASQ_RA_SUPPORT(caps)) {
- if (ipv6def)
+ if (ipv6def) {
virBufferAddLit(&configbuf, "enable-ra\n");
- else {
+ } else {
for (i = 0;
(ipdef = virNetworkDefGetIpByIndex(network->def, AF_INET6, i));
i++) {
* to sub-capabilities (like net.80203) is nasty ... so avoid it.
*/
virNodeDeviceObjRemove(&driverState->devs, dev);
- } else
+ } else {
VIR_DEBUG("no device named %s", name);
+ }
nodeDeviceUnlock(driverState);
if (dev) {
return 0;
}
- if (rule->action == VIR_NWFILTER_RULE_ACTION_ACCEPT)
+ if (rule->action == VIR_NWFILTER_RULE_ACTION_ACCEPT) {
target = accept_target;
- else {
+ } else {
target = virNWFilterJumpTargetTypeToString(rule->action);
skipMatch = defMatch;
}
/*
* nwfilter_gentech_driver.c: generic technology driver
*
- * Copyright (C) 2011, 2013 Red Hat, Inc.
+ * Copyright (C) 2011-2014 Red Hat, Inc.
* Copyright (C) 2010 IBM Corp.
* Copyright (C) 2010 Stefan Berger
*
filter->name, learning);
goto err_exit;
}
- } else
+ } else {
goto err_unresolvable_vars;
+ }
} else if (virHashSize(missing_vars->hashTable) > 1) {
goto err_unresolvable_vars;
} else if (!forceWithPendingReq &&
goto error;
}
- if (flags & VIR_STORAGE_POOL_BUILD_OVERWRITE)
+ if (flags & VIR_STORAGE_POOL_BUILD_OVERWRITE) {
ok_to_mklabel = true;
- else {
+ } else {
int check;
check = virStorageBackendDiskFindLabel(