maint: use consistent if-else braces in conf and friends

I'm about to add a syntax check that enforces our documented
HACKING style of always using matching {} on if-else statements.

This patch focuses on code shared between multiple drivers.

* src/conf/domain_conf.c (virDomainFSDefParseXML)
(virSysinfoParseXML, virDomainNetDefParseXML)
(virDomainWatchdogDefParseXML)
(virDomainRedirFilterUSBDevDefParseXML): Correct use of {}.
* src/conf/interface_conf.c (virInterfaceDefParseDhcp)
(virInterfaceDefParseIp, virInterfaceVlanDefFormat)
(virInterfaceDefParseStartMode, virInterfaceDefParseBondMode)
(virInterfaceDefParseBondMiiCarrier)
(virInterfaceDefParseBondArpValid): Likewise.
* src/conf/node_device_conf.c (virNodeDevCapStorageParseXML):
Likewise.
* src/conf/nwfilter_conf.c (virNWFilterRuleDetailsParse)
(virNWFilterRuleParse, virNWFilterDefParseXML): Likewise.
* src/conf/secret_conf.c (secretXMLParseNode): Likewise.
* src/cpu/cpu_x86.c (x86Baseline, x86FeatureLoad, x86ModelLoad):
Likewise.
* src/network/bridge_driver.c (networkKillDaemon)
(networkDnsmasqConfContents): Likewise.
* src/node_device/node_device_hal.c (dev_refresh): Likewise.
* src/nwfilter/nwfilter_gentech_driver.c (virNWFilterInstantiate):
Likewise.
* src/nwfilter/nwfilter_ebiptables_driver.c
(_iptablesCreateRuleInstance): Likewise.
* src/storage/storage_backend_disk.c
(virStorageBackendDiskBuildPool): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Eric Blake 2014-09-03 11:29:38 -06:00
parent 3020594ac5
commit ff78ff7c93
11 changed files with 92 additions and 79 deletions

View File

@ -6579,15 +6579,15 @@ virDomainFSDefParseXML(xmlNodePtr node,
xmlStrEqual(cur->name, BAD_CAST "source")) { xmlStrEqual(cur->name, BAD_CAST "source")) {
if (def->type == VIR_DOMAIN_FS_TYPE_MOUNT || 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"); 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"); 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"); 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"); 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"); usage = virXMLPropString(cur, "usage");
units = virXMLPropString(cur, "units"); units = virXMLPropString(cur, "units");
} }
@ -7129,11 +7129,11 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt,
def->data.vhostuser->data.nix.path = vhostuser_path; def->data.vhostuser->data.nix.path = vhostuser_path;
vhostuser_path = NULL; vhostuser_path = NULL;
if (STREQ(vhostuser_mode, "server")) if (STREQ(vhostuser_mode, "server")) {
def->data.vhostuser->data.nix.listen = true; 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; def->data.vhostuser->data.nix.listen = false;
else { } else {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Wrong <source> 'mode' attribute " _("Wrong <source> 'mode' attribute "
"specified with <interface " "specified with <interface "
@ -9315,9 +9315,9 @@ virDomainWatchdogDefParseXML(xmlNodePtr node,
} }
action = virXMLPropString(node, "action"); action = virXMLPropString(node, "action");
if (action == NULL) if (action == NULL) {
def->action = VIR_DOMAIN_WATCHDOG_ACTION_RESET; def->action = VIR_DOMAIN_WATCHDOG_ACTION_RESET;
else { } else {
def->action = virDomainWatchdogActionTypeFromString(action); def->action = virDomainWatchdogActionTypeFromString(action);
if (def->action < 0) { if (def->action < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@ -9612,9 +9612,9 @@ virSysinfoParseXML(xmlNodePtr node,
"%s", _("malformed <sysinfo> uuid element")); "%s", _("malformed <sysinfo> uuid element"));
goto error; goto error;
} }
if (uuid_generated) if (uuid_generated) {
memcpy(domUUID, uuidbuf, VIR_UUID_BUFLEN); 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", virReportError(VIR_ERR_XML_DETAIL, "%s",
_("UUID mismatch between <uuid> and " _("UUID mismatch between <uuid> and "
"<sysinfo>")); "<sysinfo>"));
@ -10148,11 +10148,11 @@ virDomainRedirFilterUSBDevDefParseXML(xmlNodePtr node)
allow = virXMLPropString(node, "allow"); allow = virXMLPropString(node, "allow");
if (allow) { if (allow) {
if (STREQ(allow, "yes")) if (STREQ(allow, "yes")) {
def->allow = true; def->allow = true;
else if (STREQ(allow, "no")) } else if (STREQ(allow, "no")) {
def->allow = false; def->allow = false;
else { } else {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Invalid allow value, either 'yes' or 'no'")); _("Invalid allow value, either 'yes' or 'no'"));
goto error; goto error;

View File

@ -154,15 +154,15 @@ virInterfaceDefParseStartMode(virInterfaceDefPtr def,
char *tmp; char *tmp;
tmp = virXPathString("string(./start/@mode)", ctxt); tmp = virXPathString("string(./start/@mode)", ctxt);
if (tmp == NULL) if (tmp == NULL) {
def->startmode = VIR_INTERFACE_START_UNSPECIFIED; def->startmode = VIR_INTERFACE_START_UNSPECIFIED;
else if (STREQ(tmp, "onboot")) } else if (STREQ(tmp, "onboot")) {
def->startmode = VIR_INTERFACE_START_ONBOOT; def->startmode = VIR_INTERFACE_START_ONBOOT;
else if (STREQ(tmp, "hotplug")) } else if (STREQ(tmp, "hotplug")) {
def->startmode = VIR_INTERFACE_START_HOTPLUG; def->startmode = VIR_INTERFACE_START_HOTPLUG;
else if (STREQ(tmp, "none")) } else if (STREQ(tmp, "none")) {
def->startmode = VIR_INTERFACE_START_NONE; def->startmode = VIR_INTERFACE_START_NONE;
else { } else {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
_("unknown interface startmode %s"), tmp); _("unknown interface startmode %s"), tmp);
VIR_FREE(tmp); VIR_FREE(tmp);
@ -181,21 +181,21 @@ virInterfaceDefParseBondMode(xmlXPathContextPtr ctxt)
tmp = virXPathString("string(./@mode)", ctxt); tmp = virXPathString("string(./@mode)", ctxt);
if (tmp == NULL) if (tmp == NULL)
return VIR_INTERFACE_BOND_NONE; return VIR_INTERFACE_BOND_NONE;
if (STREQ(tmp, "balance-rr")) if (STREQ(tmp, "balance-rr")) {
ret = VIR_INTERFACE_BOND_BALRR; ret = VIR_INTERFACE_BOND_BALRR;
else if (STREQ(tmp, "active-backup")) } else if (STREQ(tmp, "active-backup")) {
ret = VIR_INTERFACE_BOND_ABACKUP; ret = VIR_INTERFACE_BOND_ABACKUP;
else if (STREQ(tmp, "balance-xor")) } else if (STREQ(tmp, "balance-xor")) {
ret = VIR_INTERFACE_BOND_BALXOR; ret = VIR_INTERFACE_BOND_BALXOR;
else if (STREQ(tmp, "broadcast")) } else if (STREQ(tmp, "broadcast")) {
ret = VIR_INTERFACE_BOND_BCAST; ret = VIR_INTERFACE_BOND_BCAST;
else if (STREQ(tmp, "802.3ad")) } else if (STREQ(tmp, "802.3ad")) {
ret = VIR_INTERFACE_BOND_8023AD; ret = VIR_INTERFACE_BOND_8023AD;
else if (STREQ(tmp, "balance-tlb")) } else if (STREQ(tmp, "balance-tlb")) {
ret = VIR_INTERFACE_BOND_BALTLB; ret = VIR_INTERFACE_BOND_BALTLB;
else if (STREQ(tmp, "balance-alb")) } else if (STREQ(tmp, "balance-alb")) {
ret = VIR_INTERFACE_BOND_BALALB; ret = VIR_INTERFACE_BOND_BALALB;
else { } else {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
_("unknown bonding mode %s"), tmp); _("unknown bonding mode %s"), tmp);
ret = -1; ret = -1;
@ -213,11 +213,11 @@ virInterfaceDefParseBondMiiCarrier(xmlXPathContextPtr ctxt)
tmp = virXPathString("string(./miimon/@carrier)", ctxt); tmp = virXPathString("string(./miimon/@carrier)", ctxt);
if (tmp == NULL) if (tmp == NULL)
return VIR_INTERFACE_BOND_MII_NONE; return VIR_INTERFACE_BOND_MII_NONE;
if (STREQ(tmp, "ioctl")) if (STREQ(tmp, "ioctl")) {
ret = VIR_INTERFACE_BOND_MII_IOCTL; ret = VIR_INTERFACE_BOND_MII_IOCTL;
else if (STREQ(tmp, "netif")) } else if (STREQ(tmp, "netif")) {
ret = VIR_INTERFACE_BOND_MII_NETIF; ret = VIR_INTERFACE_BOND_MII_NETIF;
else { } else {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
_("unknown mii bonding carrier %s"), tmp); _("unknown mii bonding carrier %s"), tmp);
ret = -1; ret = -1;
@ -235,13 +235,13 @@ virInterfaceDefParseBondArpValid(xmlXPathContextPtr ctxt)
tmp = virXPathString("string(./arpmon/@validate)", ctxt); tmp = virXPathString("string(./arpmon/@validate)", ctxt);
if (tmp == NULL) if (tmp == NULL)
return VIR_INTERFACE_BOND_ARP_NONE; return VIR_INTERFACE_BOND_ARP_NONE;
if (STREQ(tmp, "active")) if (STREQ(tmp, "active")) {
ret = VIR_INTERFACE_BOND_ARP_ACTIVE; ret = VIR_INTERFACE_BOND_ARP_ACTIVE;
else if (STREQ(tmp, "backup")) } else if (STREQ(tmp, "backup")) {
ret = VIR_INTERFACE_BOND_ARP_BACKUP; ret = VIR_INTERFACE_BOND_ARP_BACKUP;
else if (STREQ(tmp, "all")) } else if (STREQ(tmp, "all")) {
ret = VIR_INTERFACE_BOND_ARP_ALL; ret = VIR_INTERFACE_BOND_ARP_ALL;
else { } else {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
_("unknown arp bonding validate %s"), tmp); _("unknown arp bonding validate %s"), tmp);
ret = -1; ret = -1;
@ -264,18 +264,19 @@ virInterfaceDefParseDhcp(virInterfaceProtocolDefPtr def,
/* Not much to do in the current version */ /* Not much to do in the current version */
tmp = virXPathString("string(./@peerdns)", ctxt); tmp = virXPathString("string(./@peerdns)", ctxt);
if (tmp) { if (tmp) {
if (STREQ(tmp, "yes")) if (STREQ(tmp, "yes")) {
def->peerdns = 1; def->peerdns = 1;
else if (STREQ(tmp, "no")) } else if (STREQ(tmp, "no")) {
def->peerdns = 0; def->peerdns = 0;
else { } else {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
_("unknown dhcp peerdns value %s"), tmp); _("unknown dhcp peerdns value %s"), tmp);
ret = -1; ret = -1;
} }
VIR_FREE(tmp); VIR_FREE(tmp);
} else } else {
def->peerdns = -1; def->peerdns = -1;
}
ctxt->node = save; ctxt->node = save;
return ret; return ret;
@ -293,9 +294,9 @@ virInterfaceDefParseIp(virInterfaceIpDefPtr def,
def->address = tmp; def->address = tmp;
if (tmp != NULL) { if (tmp != NULL) {
ret = virXPathLong("string(./@prefix)", ctxt, &l); ret = virXPathLong("string(./@prefix)", ctxt, &l);
if (ret == 0) if (ret == 0) {
def->prefix = (int) l; def->prefix = (int) l;
else if (ret == -2) { } else if (ret == -2) {
virReportError(VIR_ERR_XML_ERROR, virReportError(VIR_ERR_XML_ERROR,
"%s", _("Invalid ip address prefix value")); "%s", _("Invalid ip address prefix value"));
return -1; return -1;
@ -961,8 +962,9 @@ virInterfaceVlanDefFormat(virBufferPtr buf, const virInterfaceDef *def)
def->data.vlan.devname); def->data.vlan.devname);
virBufferAdjustIndent(buf, -2); virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</vlan>\n"); virBufferAddLit(buf, "</vlan>\n");
} else } else {
virBufferAddLit(buf, "/>\n"); virBufferAddLit(buf, "/>\n");
}
return 0; return 0;
} }

View File

@ -683,9 +683,9 @@ virNodeDevCapStorageParseXML(xmlXPathContextPtr ctxt,
goto out; goto out;
} }
if (STREQ(type, "hotpluggable")) if (STREQ(type, "hotpluggable")) {
data->storage.flags |= VIR_NODE_DEV_CAP_STORAGE_HOTPLUGGABLE; data->storage.flags |= VIR_NODE_DEV_CAP_STORAGE_HOTPLUGGABLE;
else if (STREQ(type, "removable")) { } else if (STREQ(type, "removable")) {
xmlNodePtr orignode2; xmlNodePtr orignode2;
data->storage.flags |= VIR_NODE_DEV_CAP_STORAGE_REMOVABLE; data->storage.flags |= VIR_NODE_DEV_CAP_STORAGE_REMOVABLE;

View File

@ -1858,10 +1858,12 @@ virNWFilterRuleDetailsParse(xmlNodePtr node,
item->u.u8 = uint_val; item->u.u8 = uint_val;
found = true; found = true;
data.ui = uint_val; data.ui = uint_val;
} else } else {
rc = -1; rc = -1;
} else }
} else {
rc = -1; rc = -1;
}
break; break;
case DATATYPE_UINT16_HEX: case DATATYPE_UINT16_HEX:
@ -1873,10 +1875,12 @@ virNWFilterRuleDetailsParse(xmlNodePtr node,
item->u.u16 = uint_val; item->u.u16 = uint_val;
found = true; found = true;
data.ui = uint_val; data.ui = uint_val;
} else } else {
rc = -1; rc = -1;
} else }
} else {
rc = -1; rc = -1;
}
break; break;
case DATATYPE_UINT32_HEX: case DATATYPE_UINT32_HEX:
@ -1887,8 +1891,9 @@ virNWFilterRuleDetailsParse(xmlNodePtr node,
item->u.u32 = uint_val; item->u.u32 = uint_val;
found = true; found = true;
data.ui = uint_val; data.ui = uint_val;
} else } else {
rc = -1; rc = -1;
}
break; break;
case DATATYPE_IPADDR: case DATATYPE_IPADDR:
@ -1904,8 +1909,9 @@ virNWFilterRuleDetailsParse(xmlNodePtr node,
item->u.u8 = (uint8_t)uint_val; item->u.u8 = (uint8_t)uint_val;
found = true; found = true;
data.ui = uint_val; data.ui = uint_val;
} else } else {
rc = -1; rc = -1;
}
} else { } else {
if (virSocketAddrParseIPv4(&ipaddr, prop) < 0) { if (virSocketAddrParseIPv4(&ipaddr, prop) < 0) {
rc = -1; rc = -1;
@ -1951,8 +1957,9 @@ virNWFilterRuleDetailsParse(xmlNodePtr node,
item->u.u8 = (uint8_t)uint_val; item->u.u8 = (uint8_t)uint_val;
found = true; found = true;
data.ui = uint_val; data.ui = uint_val;
} else } else {
rc = -1; rc = -1;
}
} else { } else {
if (virSocketAddrParseIPv6(&ipaddr, prop) < 0) { if (virSocketAddrParseIPv6(&ipaddr, prop) < 0) {
rc = -1; rc = -1;
@ -2457,10 +2464,11 @@ virNWFilterRuleParse(xmlNodePtr node)
i++; i++;
if (!virAttr[i].id) if (!virAttr[i].id)
break; break;
} else } else {
break; break;
} }
} }
}
cur = cur->next; cur = cur->next;
} }
@ -2667,9 +2675,10 @@ virNWFilterDefParseXML(xmlXPathContextPtr ctxt)
virNWFilterEntryFree(entry); virNWFilterEntryFree(entry);
goto cleanup; goto cleanup;
} }
} else } else {
virNWFilterEntryFree(entry); virNWFilterEntryFree(entry);
} }
}
curr = curr->next; curr = curr->next;
} }

View File

@ -159,11 +159,11 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root)
prop = virXPathString("string(./@ephemeral)", ctxt); prop = virXPathString("string(./@ephemeral)", ctxt);
if (prop != NULL) { if (prop != NULL) {
if (STREQ(prop, "yes")) if (STREQ(prop, "yes")) {
def->ephemeral = true; def->ephemeral = true;
else if (STREQ(prop, "no")) } else if (STREQ(prop, "no")) {
def->ephemeral = false; def->ephemeral = false;
else { } else {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("invalid value of 'ephemeral'")); _("invalid value of 'ephemeral'"));
goto cleanup; goto cleanup;
@ -173,11 +173,11 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root)
prop = virXPathString("string(./@private)", ctxt); prop = virXPathString("string(./@private)", ctxt);
if (prop != NULL) { if (prop != NULL) {
if (STREQ(prop, "yes")) if (STREQ(prop, "yes")) {
def->private = true; def->private = true;
else if (STREQ(prop, "no")) } else if (STREQ(prop, "no")) {
def->private = false; def->private = false;
else { } else {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("invalid value of 'private'")); _("invalid value of 'private'"));
goto cleanup; goto cleanup;

View File

@ -1,7 +1,7 @@
/* /*
* cpu_x86.c: CPU driver for CPUs with x86 compatible CPUID instruction * 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 * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -710,9 +710,9 @@ x86FeatureLoad(xmlXPathContextPtr ctxt,
goto error; goto error;
} }
if (map->features == NULL) if (map->features == NULL) {
map->features = feature; map->features = feature;
else { } else {
feature->next = map->features; feature->next = map->features;
map->features = feature; map->features = feature;
} }
@ -1048,9 +1048,9 @@ x86ModelLoad(xmlXPathContextPtr ctxt,
goto error; goto error;
} }
if (map->models == NULL) if (map->models == NULL) {
map->models = model; map->models = model;
else { } else {
model->next = map->models; model->next = map->models;
map->models = model; map->models = model;
} }
@ -1882,9 +1882,9 @@ x86Baseline(virCPUDefPtr *cpus,
cpu->type = VIR_CPU_TYPE_GUEST; cpu->type = VIR_CPU_TYPE_GUEST;
cpu->match = VIR_CPU_MATCH_EXACT; cpu->match = VIR_CPU_MATCH_EXACT;
if (!cpus[0]->vendor) if (!cpus[0]->vendor) {
outputVendor = false; outputVendor = false;
else if (!(vendor = x86VendorFind(map, cpus[0]->vendor))) { } else if (!(vendor = x86VendorFind(map, cpus[0]->vendor))) {
virReportError(VIR_ERR_OPERATION_FAILED, virReportError(VIR_ERR_OPERATION_FAILED,
_("Unknown CPU vendor %s"), cpus[0]->vendor); _("Unknown CPU vendor %s"), cpus[0]->vendor);
goto error; goto error;
@ -1914,9 +1914,9 @@ x86Baseline(virCPUDefPtr *cpus,
goto error; goto error;
} }
if (cpus[i]->vendor) if (cpus[i]->vendor) {
vn = cpus[i]->vendor; vn = cpus[i]->vendor;
else { } else {
outputVendor = false; outputVendor = false;
if (model->vendor) if (model->vendor)
vn = model->vendor->name; vn = model->vendor->name;

View File

@ -782,9 +782,9 @@ networkKillDaemon(pid_t pid, const char *daemonName, const char *networkName)
*/ */
for (i = 0; i < 25; i++) { for (i = 0; i < 25; i++) {
int signum = 0; int signum = 0;
if (i == 0) if (i == 0) {
signum = SIGTERM; signum = SIGTERM;
else if (i == 15) { } else if (i == 15) {
signum = SIGKILL; signum = SIGKILL;
signame = "KILL"; signame = "KILL";
} }
@ -1221,9 +1221,9 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
/* Are we doing RA instead of radvd? */ /* Are we doing RA instead of radvd? */
if (DNSMASQ_RA_SUPPORT(caps)) { if (DNSMASQ_RA_SUPPORT(caps)) {
if (ipv6def) if (ipv6def) {
virBufferAddLit(&configbuf, "enable-ra\n"); virBufferAddLit(&configbuf, "enable-ra\n");
else { } else {
for (i = 0; for (i = 0;
(ipdef = virNetworkDefGetIpByIndex(network->def, AF_INET6, i)); (ipdef = virNetworkDefGetIpByIndex(network->def, AF_INET6, i));
i++) { i++) {

View File

@ -546,8 +546,9 @@ dev_refresh(const char *udi)
* to sub-capabilities (like net.80203) is nasty ... so avoid it. * to sub-capabilities (like net.80203) is nasty ... so avoid it.
*/ */
virNodeDeviceObjRemove(&driverState->devs, dev); virNodeDeviceObjRemove(&driverState->devs, dev);
} else } else {
VIR_DEBUG("no device named %s", name); VIR_DEBUG("no device named %s", name);
}
nodeDeviceUnlock(driverState); nodeDeviceUnlock(driverState);
if (dev) { if (dev) {

View File

@ -1509,9 +1509,9 @@ _iptablesCreateRuleInstance(virFirewallPtr fw,
return 0; return 0;
} }
if (rule->action == VIR_NWFILTER_RULE_ACTION_ACCEPT) if (rule->action == VIR_NWFILTER_RULE_ACTION_ACCEPT) {
target = accept_target; target = accept_target;
else { } else {
target = virNWFilterJumpTargetTypeToString(rule->action); target = virNWFilterJumpTargetTypeToString(rule->action);
skipMatch = defMatch; skipMatch = defMatch;
} }

View File

@ -1,7 +1,7 @@
/* /*
* nwfilter_gentech_driver.c: generic technology driver * 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 IBM Corp.
* Copyright (C) 2010 Stefan Berger * Copyright (C) 2010 Stefan Berger
* *
@ -699,8 +699,9 @@ virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED,
filter->name, learning); filter->name, learning);
goto err_exit; goto err_exit;
} }
} else } else {
goto err_unresolvable_vars; goto err_unresolvable_vars;
}
} else if (virHashSize(missing_vars->hashTable) > 1) { } else if (virHashSize(missing_vars->hashTable) > 1) {
goto err_unresolvable_vars; goto err_unresolvable_vars;
} else if (!forceWithPendingReq && } else if (!forceWithPendingReq &&

View File

@ -414,9 +414,9 @@ virStorageBackendDiskBuildPool(virConnectPtr conn ATTRIBUTE_UNUSED,
goto error; goto error;
} }
if (flags & VIR_STORAGE_POOL_BUILD_OVERWRITE) if (flags & VIR_STORAGE_POOL_BUILD_OVERWRITE) {
ok_to_mklabel = true; ok_to_mklabel = true;
else { } else {
int check; int check;
check = virStorageBackendDiskFindLabel( check = virStorageBackendDiskFindLabel(