++length;
}
- if (VIR_ALLOC_N(escaped, length) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC_N(escaped, length) < 0)
return NULL;
- }
tmp1 = string; /* reading from this one */
tmp2 = escaped; /* writing to this one */
int count = 0;
int *autodetectedModels;
- if (VIR_ALLOC_N(autodetectedModels, def->ndisks) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC_N(autodetectedModels, def->ndisks) < 0)
return -1;
- }
for (i = 0; i < def->ncontrollers; ++i) {
controller = def->controllers[i];
}
/* Allocate domain def */
- if (VIR_ALLOC(def) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC(def) < 0)
goto cleanup;
- }
def->virtType = VIR_DOMAIN_VIRT_VMWARE;
def->id = -1;
cpumasklen = 0;
def->cpumask = virBitmapNew(VIR_DOMAIN_CPUMASK_LEN);
- if (!def->cpumask) {
- virReportOOMError();
+ if (!def->cpumask)
goto cleanup;
- }
while (*current != '\0') {
virSkipSpaces(¤t);
/* FIXME */
/* def:graphics */
- if (VIR_ALLOC_N(def->graphics, 1) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC_N(def->graphics, 1) < 0)
goto cleanup;
- }
def->ngraphics = 0;
}
/* def:disks: 4 * 15 scsi + 2 * 2 ide + 2 floppy = 66 */
- if (VIR_ALLOC_N(def->disks, 66) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC_N(def->disks, 66) < 0)
goto cleanup;
- }
def->ndisks = 0;
if (sharedFolder_maxNum > 0) {
int number;
- if (VIR_ALLOC_N(def->fss, sharedFolder_maxNum) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC_N(def->fss, sharedFolder_maxNum) < 0)
goto cleanup;
- }
def->nfss = 0;
}
/* def:nets */
- if (VIR_ALLOC_N(def->nets, 4) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC_N(def->nets, 4) < 0)
goto cleanup;
- }
def->nnets = 0;
/* FIXME */
/* def:videos */
- if (VIR_ALLOC_N(def->videos, 1) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC_N(def->videos, 1) < 0)
goto cleanup;
- }
def->nvideos = 0;
/* FIXME */
/* def:serials */
- if (VIR_ALLOC_N(def->serials, 4) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC_N(def->serials, 4) < 0)
goto cleanup;
- }
def->nserials = 0;
}
/* def:parallels */
- if (VIR_ALLOC_N(def->parallels, 3) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC_N(def->parallels, 3) < 0)
goto cleanup;
- }
def->nparallels = 0;
return 0;
}
- if (VIR_ALLOC(*def) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC(*def) < 0)
goto failure;
- }
(*def)->type = VIR_DOMAIN_GRAPHICS_TYPE_VNC;
return -1;
}
- if (VIR_ALLOC(*def) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC(*def) < 0)
return -1;
- }
(*def)->device = device;
(*def)->bus = busType;
goto cleanup;
}
- if (virAsprintf(&prefix, "scsi%d:%d", controllerOrBus, unit) < 0) {
- virReportOOMError();
+ if (virAsprintf(&prefix, "scsi%d:%d", controllerOrBus, unit) < 0)
goto cleanup;
- }
(*def)->dst =
virIndexToDiskName
goto cleanup;
}
- if (virAsprintf(&prefix, "ide%d:%d", controllerOrBus, unit) < 0) {
- virReportOOMError();
+ if (virAsprintf(&prefix, "ide%d:%d", controllerOrBus, unit) < 0)
goto cleanup;
- }
(*def)->dst = virIndexToDiskName(controllerOrBus * 2 + unit, "hd");
goto cleanup;
}
- if (virAsprintf(&prefix, "floppy%d", unit) < 0) {
- virReportOOMError();
+ if (virAsprintf(&prefix, "floppy%d", unit) < 0)
goto cleanup;
- }
(*def)->dst = virIndexToDiskName(unit, "fd");
return -1;
}
- if (VIR_ALLOC(*def) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC(*def) < 0)
return -1;
- }
(*def)->type = VIR_DOMAIN_FS_TYPE_MOUNT;
return -1;
}
- if (VIR_ALLOC(*def) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC(*def) < 0)
return -1;
- }
snprintf(prefix, sizeof(prefix), "ethernet%d", controller);
return -1;
}
- if (VIR_ALLOC(*def) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC(*def) < 0)
return -1;
- }
(*def)->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL;
goto cleanup;
if (virAsprintf(&(*def)->source.data.tcp.service, "%d",
- parsedUri->port) < 0) {
- virReportOOMError();
+ parsedUri->port) < 0)
goto cleanup;
- }
/* See vSphere API documentation about VirtualSerialPortURIBackingInfo */
if (parsedUri->scheme == NULL ||
return -1;
}
- if (VIR_ALLOC(*def) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC(*def) < 0)
return -1;
- }
(*def)->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL;
return -1;
}
- if (VIR_ALLOC(*def) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC(*def) < 0)
return -1;
- }
(*def)->type = VIR_DOMAIN_VIDEO_TYPE_VMVGA;