nodeInfo->sockets * nodeInfo->nodes);
ret = virXPathLong("string(/node/cpu/active[1])", ctxt, &l);
if (ret == 0) {
- if (l < nodeInfo->cpus) {
+ if (l < nodeInfo->cpus)
nodeInfo->cpus = l;
- }
} else if (ret == -2) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("invalid node cpu active value"));
virDomainObjPtr obj;
num = virXPathNodeSet("/node/domain", ctxt, &nodes);
- if (num < 0) {
+ if (num < 0)
goto error;
- }
for (i = 0; i < num; i++) {
virDomainDefPtr def;
virNetworkObjPtr obj;
num = virXPathNodeSet("/node/network", ctxt, &nodes);
- if (num < 0) {
+ if (num < 0)
goto error;
- }
for (i = 0; i < num; i++) {
virNetworkDefPtr def;
virInterfaceObjPtr obj;
num = virXPathNodeSet("/node/interface", ctxt, &nodes);
- if (num < 0) {
+ if (num < 0)
goto error;
- }
for (i = 0; i < num; i++) {
virInterfaceDefPtr def;
num = virXPathNodeSet(vol_xpath, ctxt, &nodes);
VIR_FREE(vol_xpath);
- if (num < 0) {
+ if (num < 0)
goto error;
- }
for (i = 0; i < num; i++) {
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file,
virStoragePoolObjPtr obj;
num = virXPathNodeSet("/node/pool", ctxt, &nodes);
- if (num < 0) {
+ if (num < 0)
goto error;
- }
for (i = 0; i < num; i++) {
virStoragePoolDefPtr def;
virNodeDeviceObjPtr obj;
num = virXPathNodeSet("/node/device", ctxt, &nodes);
- if (num < 0) {
+ if (num < 0)
goto error;
- }
for (i = 0; i < num; i++) {
virNodeDeviceDefPtr def;
if (!(privconn->eventState = virObjectEventStateNew()))
goto error;
- if (!(doc = virXMLParseFileCtxt(file, &ctxt))) {
+ if (!(doc = virXMLParseFileCtxt(file, &ctxt)))
goto error;
- }
if (!xmlStrEqual(ctxt->node->name, BAD_CAST "node")) {
virReportError(VIR_ERR_XML_ERROR, "%s",
case VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG:
ret = testDomainUpdateVCPUs(privconn, privdom, nrCpus, 0);
- if (ret == 0) {
+ if (ret == 0)
persistentDef->vcpus = nrCpus;
- }
break;
}
unsigned char *cpumap = VIR_GET_CPUMAP(cpumaps, maplen, v);
for (i = 0; i < maxcpu; i++) {
- if (VIR_CPU_USABLE(privdomdata->cpumaps, privmaplen, v, i)) {
+ if (VIR_CPU_USABLE(privdomdata->cpumaps, privmaplen, v, i))
VIR_USE_CPU(cpumap, i);
- }
}
}
}
memset(privcpumap, 0, privmaplen);
for (i = 0; i < maxcpu; i++) {
- if (VIR_CPU_USABLE(cpumap, maplen, 0, i)) {
+ if (VIR_CPU_USABLE(cpumap, maplen, 0, i))
VIR_USE_CPU(privcpumap, i);
- }
}
ret = 0;
testDriverLock(privconn);
for (i = 0; (i < privconn->ifaces.count); i++) {
virInterfaceObjLock(privconn->ifaces.objs[i]);
- if (virInterfaceObjIsActive(privconn->ifaces.objs[i])) {
+ if (virInterfaceObjIsActive(privconn->ifaces.objs[i]))
count++;
- }
virInterfaceObjUnlock(privconn->ifaces.objs[i]);
}
testDriverUnlock(privconn);
testDriverLock(privconn);
for (i = 0; i < privconn->ifaces.count; i++) {
virInterfaceObjLock(privconn->ifaces.objs[i]);
- if (!virInterfaceObjIsActive(privconn->ifaces.objs[i])) {
+ if (!virInterfaceObjIsActive(privconn->ifaces.objs[i]))
count++;
- }
virInterfaceObjUnlock(privconn->ifaces.objs[i]);
}
testDriverUnlock(privconn);
testDriverLock(driver);
def = virNodeDeviceDefParseString(xmlDesc, CREATE_DEVICE, NULL);
- if (def == NULL) {
+ if (def == NULL)
goto cleanup;
- }
/* We run these next two simply for validation */
- if (virNodeDeviceGetWWNs(def, &wwnn, &wwpn) == -1) {
+ if (virNodeDeviceGetWWNs(def, &wwnn, &wwpn) == -1)
goto cleanup;
- }
if (virNodeDeviceGetParentHost(&driver->devs,
def->name,
}
- if (!(obj = virNodeDeviceAssignDef(&driver->devs, def))) {
+ if (!(obj = virNodeDeviceAssignDef(&driver->devs, def)))
goto cleanup;
- }
virNodeDeviceObjUnlock(obj);
dev = virGetNodeDevice(conn, def->name);
goto out;
}
- if (virNodeDeviceGetWWNs(obj->def, &wwnn, &wwpn) == -1) {
+ if (virNodeDeviceGetWWNs(obj->def, &wwnn, &wwpn) == -1)
goto out;
- }
if (VIR_STRDUP(parent_name, obj->def->parent) < 0)
goto out;
virDomainSnapshotObjPtr snap = payload;
testSnapReparentDataPtr rep = data;
- if (rep->err < 0) {
+ if (rep->err < 0)
return;
- }
VIR_FREE(snap->def->parent);
snap->parent = rep->parent;
testDomainSnapshotDiscardAll,
&rem);
if (rem.current) {
- if (flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY) {
+ if (flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY)
snap->def->current = true;
- }
vm->current_snapshot = snap;
}
} else if (snap->nchildren) {