bool check_active)
{
int ret = -1;
- int dupVM = 0;
virNetworkObjPtr vm = NULL;
/* See if a VM with matching UUID already exists */
}
}
- dupVM = 1;
+ ret = 1;
} else {
/* UUID does not match, but if a name matches, refuse it */
vm = virNetworkFindByName(doms, def->name);
def->name, uuidstr);
goto cleanup;
}
+ ret = 0;
}
- ret = dupVM;
cleanup:
if (vm)
virNetworkObjUnlock(vm);
unsigned int check_active)
{
int ret = -1;
- int dupPool = 0;
virStoragePoolObjPtr pool = NULL;
/* See if a Pool with matching UUID already exists */
}
}
- dupPool = 1;
+ ret = 1;
} else {
/* UUID does not match, but if a name matches, refuse it */
pool = virStoragePoolObjFindByName(pools, def->name);
def->name, uuidstr);
goto cleanup;
}
+ ret = 0;
}
- ret = dupPool;
cleanup:
if (pool)
virStoragePoolObjUnlock(pool);
uint8_t *pmtype, uint32_t *pleasetime)
{
int oind, olen;
- int oend;
uint32_t nwint;
olen = len - sizeof(*pd);
oind += sizeof(dhcp_magic);
- oend = 0;
-
*pmtype = 0;
*pleasetime = 0;
oind++;
continue;
case DHCPO_END:
- oend = 1;
- break;
+ return 0;
default:
if (olen - oind < 2)
goto malformed;
}
- if (oend)
- break;
oind += pd->d_opts[oind + 1] + 2;
}
return 0;
qemuProcessFiltersInstantiate(virConnectPtr conn,
virDomainDefPtr def)
{
- int err = 0;
int i;
if (!conn)
for (i = 0; i < def->nnets; i++) {
virDomainNetDefPtr net = def->nets[i];
if ((net->filter) && (net->ifname)) {
- if (virDomainConfNWFilterInstantiate(conn, def->uuid, net) < 0) {
- err = 1;
- break;
- }
+ if (virDomainConfNWFilterInstantiate(conn, def->uuid, net) < 0)
+ return 1;
}
}
- return err;
+ return 0;
}
static int
struct ifla_vf_vlan *vf_vlan;
struct nlattr *tb_vf_info = {NULL, };
struct nlattr *tb_vf[IFLA_VF_MAX+1];
- int found = 0;
int rem;
if (!tb[IFLA_VFINFO_LIST]) {
vf_mac = RTA_DATA(tb_vf[IFLA_VF_MAC]);
if (vf_mac && vf_mac->vf == vf) {
virMacAddrSetRaw(mac, vf_mac->mac);
- found = 1;
+ rc = 0;
}
}
vf_vlan = RTA_DATA(tb_vf[IFLA_VF_VLAN]);
if (vf_vlan && vf_vlan->vf == vf) {
*vlanid = vf_vlan->vlan;
- found = 1;
+ rc = 0;
}
}
- if (found) {
- rc = 0;
- goto cleanup;
- }
+
+ if (rc == 0)
+ break;
}
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("couldn't find IFLA_VF_INFO for VF %d "
- "in netlink response"), vf);
+ if (rc < 0)
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("couldn't find IFLA_VF_INFO for VF %d "
+ "in netlink response"), vf);
cleanup:
return rc;
}