virInterfaceDef *def;
/* Allocate our interface definition structure */
- if (VIR_ALLOC(def) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC(def) < 0)
return NULL;
- }
if (VIR_STRDUP(def->name, ncf_if_name(iface)) < 0)
goto cleanup;
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
if (VIR_ALLOC(driverState) < 0)
- {
- virReportOOMError();
goto alloc_error;
- }
/* initialize non-0 stuff in driverState */
if (virMutexInit(&driverState->lock) < 0)
goto cleanup;
}
- if (VIR_ALLOC_N(names, count) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC_N(names, count) < 0)
goto cleanup;
- }
if ((count = ncf_list_interfaces(driver->netcf, count, names, status)) < 0) {
const char *errmsg, *details;
goto cleanup;
}
- if (VIR_ALLOC_N(allnames, count) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC_N(allnames, count) < 0)
goto cleanup;
- }
if ((count = ncf_list_interfaces(driver->netcf, count, allnames, status)) < 0) {
const char *errmsg, *details;
goto cleanup;
}
- if (VIR_ALLOC_N(names, count) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC_N(names, count) < 0)
goto cleanup;
- }
if ((count = ncf_list_interfaces(driver->netcf, count, names,
NETCF_IFACE_ACTIVE |
goto cleanup;
}
- if (ifaces) {
- if (VIR_ALLOC_N(tmp_iface_objs, count + 1) < 0) {
- virReportOOMError();
- goto cleanup;
- }
- }
+ if (ifaces && VIR_ALLOC_N(tmp_iface_objs, count + 1) < 0)
+ goto cleanup;
for (i = 0; i < count; i++) {
virInterfaceDefPtr def;
virInterfaceDef *def;
/* Allocate our interface definition structure */
- if (VIR_ALLOC(def) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC(def) < 0)
return NULL;
- }
if (VIR_STRDUP(def->name, udev_device_get_sysname(dev)) < 0)
goto cleanup;
virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR);
- if (VIR_ALLOC(driverState) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC(driverState) < 0)
goto cleanup;
- }
driverState->udev = udev_new();
if (!driverState->udev) {
}
/* If we're asked for the ifaces then alloc up memory */
- if (ifaces) {
- if (VIR_ALLOC_N(ifaces_list, count + 1) < 0) {
- virReportOOMError();
- ret = -1;
- goto cleanup;
- }
+ if (ifaces && VIR_ALLOC_N(ifaces_list, count + 1) < 0) {
+ ret = -1;
+ goto cleanup;
}
/* Get a list we can walk */
}
/* Allocate our list of slave devices */
- if (VIR_ALLOC_N(ifacedef->data.bond.itf, slave_count) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC_N(ifacedef->data.bond.itf, slave_count) < 0)
goto error;
- }
ifacedef->data.bond.nbItf = slave_count;
for (i = 0; i < slave_count; i++) {
/* Members of the bridge */
if (virAsprintf(&member_path, "%s/%s",
- udev_device_get_syspath(dev), "brif") < 0) {
- virReportOOMError();
+ udev_device_get_syspath(dev), "brif") < 0)
goto error;
- }
/* Get each member of the bridge */
member_count = scandir(member_path, &member_list,
}
/* Allocate our list of member devices */
- if (VIR_ALLOC_N(ifacedef->data.bridge.itf, member_count) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC_N(ifacedef->data.bridge.itf, member_count) < 0)
goto error;
- }
ifacedef->data.bridge.nbItf = member_count;
/* Get the interface defintions for each member of the bridge */
const char *devtype;
/* Allocate our interface definition structure */
- if (VIR_ALLOC(ifacedef) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC(ifacedef) < 0)
return NULL;
- }
/* Clear our structure and set safe defaults */
ifacedef->startmode = VIR_INTERFACE_START_UNSPECIFIED;