virInterfacePtr ret = NULL;
if (!(obj = testInterfaceObjFindByName(privconn, name)))
- goto cleanup;
+ return NULL;
ret = virGetInterface(conn, obj->def->name, obj->def->mac);
- cleanup:
- if (obj)
- virInterfaceObjUnlock(obj);
+ virInterfaceObjUnlock(obj);
return ret;
}
int ret = -1;
if (!(obj = testInterfaceObjFindByName(privconn, iface->name)))
- goto cleanup;
+ return -1;
ret = virInterfaceObjIsActive(obj);
- cleanup:
- if (obj)
- virInterfaceObjUnlock(obj);
+ virInterfaceObjUnlock(obj);
return ret;
}
virCheckFlags(0, NULL);
if (!(obj = testInterfaceObjFindByName(privconn, iface->name)))
- goto cleanup;
+ return NULL;
ret = virInterfaceDefFormat(obj->def);
- cleanup:
- if (obj)
- virInterfaceObjUnlock(obj);
+ virInterfaceObjUnlock(obj);
return ret;
}
{
testDriverPtr privconn = iface->conn->privateData;
virInterfaceObjPtr obj;
- int ret = -1;
if (!(obj = testInterfaceObjFindByName(privconn, iface->name)))
- goto cleanup;
+ return -1;
virInterfaceObjRemove(&privconn->ifaces, obj);
- ret = 0;
- cleanup:
- return ret;
+ return 0;
}
virCheckFlags(0, -1);
if (!(obj = testInterfaceObjFindByName(privconn, iface->name)))
- goto cleanup;
+ return -1;
if (obj->active != 0) {
virReportError(VIR_ERR_OPERATION_INVALID, NULL);
ret = 0;
cleanup:
- if (obj)
- virInterfaceObjUnlock(obj);
+ virInterfaceObjUnlock(obj);
return ret;
}
virCheckFlags(0, -1);
if (!(obj = testInterfaceObjFindByName(privconn, iface->name)))
- goto cleanup;
+ return -1;
if (obj->active == 0) {
virReportError(VIR_ERR_OPERATION_INVALID, NULL);
ret = 0;
cleanup:
- if (obj)
- virInterfaceObjUnlock(obj);
+ virInterfaceObjUnlock(obj);
return ret;
}