NULL, NULL, 0, NULL) == NULL)
goto error;
- if (VIR_ALLOC(cpu) < 0) {
- virReportOOMError();
+ if (VIR_ALLOC(cpu) < 0)
goto error;
- }
if (!(cpu->arch = caps->host.arch)) {
virReportOOMError();
int
vmwareConstructVmxPath(char *directoryName, char *name, char **vmxPath)
{
- if (directoryName != NULL) {
- if (virAsprintf(vmxPath, "%s/%s.vmx", directoryName, name) < 0) {
- virReportOOMError();
- return -1;
- }
- } else {
- if (virAsprintf(vmxPath, "%s.vmx", name) < 0) {
- virReportOOMError();
- return -1;
- }
- }
- return 0;
+ if (directoryName != NULL)
+ return virAsprintf(vmxPath, "%s/%s.vmx", directoryName, name);
+ return virAsprintf(vmxPath, "%s.vmx", name);
}
int
goto cleanup;
}
- if (vmwareConstructVmxPath(directoryName, vmdef->name, vmxPath) < 0) {
- virReportOOMError();
+ if (vmwareConstructVmxPath(directoryName, vmdef->name, vmxPath) < 0)
goto cleanup;
- }
ret = 0;
int
vmwareMakePath(char *srcDir, char *srcName, char *srcExt, char **outpath)
{
- if (virAsprintf(outpath, "%s/%s.%s", srcDir, srcName, srcExt) < 0) {
- virReportOOMError();
- return -1;
- }
- return 0;
+ return virAsprintf(outpath, "%s/%s.%s", srcDir, srcName, srcExt);
}
int
goto cleanup;
if (virAsprintf(&logFilePath, "%s/vmware.log",
- vmxDir) < 0) {
- virReportOOMError();
+ vmxDir) < 0)
goto cleanup;
- }
if ((logFile = fopen(logFilePath, "r")) == NULL)
goto cleanup;