goto cleanup;
if ((tmp = STRSKIP(outbuf, pattern)) == NULL) {
- vmwareError(VIR_ERR_INTERNAL_ERROR,
- _("failed to parse %s version"), bin);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to parse %s version"), bin);
goto cleanup;
}
if (virParseVersionString(tmp, &version, false) < 0) {
- vmwareError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("version parsing error"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("version parsing error"));
goto cleanup;
}
*separator++ = '\0';
if (*separator == '\0') {
- vmwareError(VIR_ERR_INTERNAL_ERROR,
- _("path '%s' doesn't reference a file"), path);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("path '%s' doesn't reference a file"), path);
return -1;
}
* isn't perfect but should work in the majority of cases.
*/
if (vmdef->ndisks < 1) {
- vmwareError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Domain XML doesn't contain any disks, "
- "cannot deduce datastore and path for VMX file"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Domain XML doesn't contain any disks, "
+ "cannot deduce datastore and path for VMX file"));
goto cleanup;
}
}
if (disk == NULL) {
- vmwareError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Domain XML doesn't contain any file-based harddisks, "
- "cannot deduce datastore and path for VMX file"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Domain XML doesn't contain any file-based harddisks, "
+ "cannot deduce datastore and path for VMX file"));
goto cleanup;
}
if (disk->src == NULL) {
- vmwareError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("First file-based harddisk has no source, cannot "
- "deduce datastore and path for VMX file"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("First file-based harddisk has no source, cannot "
+ "deduce datastore and path for VMX file"));
goto cleanup;
}
}
if (!virFileHasSuffix(fileName, ".vmdk")) {
- vmwareError(VIR_ERR_INTERNAL_ERROR,
- _("Expecting source '%s' of first file-based harddisk "
- "to be a VMDK image"), disk->src);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Expecting source '%s' of first file-based harddisk "
+ "to be a VMDK image"), disk->src);
goto cleanup;
}
{ "mv", PROGRAM_SENTINAL, PROGRAM_SENTINAL, NULL };
if (!virFileExists(srcFile)) {
- vmwareError(VIR_ERR_INTERNAL_ERROR, _("file %s does not exist"),
- srcFile);
+ virReportError(VIR_ERR_INTERNAL_ERROR, _("file %s does not exist"),
+ srcFile);
return -1;
}
vmwareSetSentinal(cmdmv, srcFile);
vmwareSetSentinal(cmdmv, dstFile);
if (virRun(cmdmv, NULL) < 0) {
- vmwareError(VIR_ERR_INTERNAL_ERROR,
- _("failed to move file to %s "), dstFile);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("failed to move file to %s "), dstFile);
return -1;
}
goto cleanup;
if (!fgets(line, sizeof(line), logFile)) {
- vmwareError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("unable to read vmware log file"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("unable to read vmware log file"));
goto cleanup;
}
if ((tmp = strstr(line, " pid=")) == NULL) {
- vmwareError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot find pid in vmware log file"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot find pid in vmware log file"));
goto cleanup;
}
/* Although 64-bit windows allows 64-bit pid_t, a domain id has to be
* 32 bits. For now, we just reject pid values that overflow int. */
if (virStrToLong_i(tmp, &tmp, 10, &pid_value) < 0 || *tmp != ' ') {
- vmwareError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("cannot parse pid in vmware log file"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot parse pid in vmware log file"));
goto cleanup;
}
/* If path isn't /session, then they typoed, so tell them correct path */
if (conn->uri->path == NULL || STRNEQ(conn->uri->path, "/session")) {
- vmwareError(VIR_ERR_INTERNAL_ERROR,
- _("unexpected VMware URI path '%s', try vmwareplayer:///session or vmwarews:///session"),
- NULLSTR(conn->uri->path));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unexpected VMware URI path '%s', try vmwareplayer:///session or vmwarews:///session"),
+ NULLSTR(conn->uri->path));
return VIR_DRV_OPEN_ERROR;
}
}
vmrun = virFindFileInPath(VMRUN);
if (vmrun == NULL) {
- vmwareError(VIR_ERR_INTERNAL_ERROR,
- _("%s utility is missing"), VMRUN);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("%s utility is missing"), VMRUN);
return VIR_DRV_OPEN_ERROR;
} else {
VIR_FREE(vmrun);
const char *vmxPath = ((vmwareDomainPtr) vm->privateData)->vmxPath;
if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_SHUTOFF) {
- vmwareError(VIR_ERR_OPERATION_INVALID, "%s",
- _("domain is not in shutoff state"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("domain is not in shutoff state"));
return -1;
}
/* create vmx file */
if (virFileWriteStr(vmxPath, vmx, S_IRUSR|S_IWUSR) < 0) {
- vmwareError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to write vmx file '%s'"), vmxPath);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to write vmx file '%s'"), vmxPath);
goto cleanup;
}
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
if (!vm) {
- vmwareError(VIR_ERR_NO_DOMAIN, "%s",
- _("no domain with matching uuid"));
+ virReportError(VIR_ERR_NO_DOMAIN, "%s",
+ _("no domain with matching uuid"));
goto cleanup;
}
goto cleanup;
if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_RUNNING) {
- vmwareError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("domain is not in running state"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("domain is not in running state"));
goto cleanup;
}
int ret = -1;
if (driver->type == TYPE_PLAYER) {
- vmwareError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("vmplayer does not support libvirt suspend/resume"
- " (vmware pause/unpause) operation "));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("vmplayer does not support libvirt suspend/resume"
+ " (vmware pause/unpause) operation "));
return ret;
}
vmwareDriverUnlock(driver);
if (!vm) {
- vmwareError(VIR_ERR_NO_DOMAIN, "%s",
- _("no domain with matching uuid"));
+ virReportError(VIR_ERR_NO_DOMAIN, "%s",
+ _("no domain with matching uuid"));
goto cleanup;
}
vmwareSetSentinal(cmd, vmw_types[driver->type]);
vmwareSetSentinal(cmd, ((vmwareDomainPtr) vm->privateData)->vmxPath);
if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_RUNNING) {
- vmwareError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("domain is not in running state"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("domain is not in running state"));
goto cleanup;
}
int ret = -1;
if (driver->type == TYPE_PLAYER) {
- vmwareError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("vmplayer does not support libvirt suspend/resume"
- "(vmware pause/unpause) operation "));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("vmplayer does not support libvirt suspend/resume"
+ "(vmware pause/unpause) operation "));
return ret;
}
vmwareDriverUnlock(driver);
if (!vm) {
- vmwareError(VIR_ERR_NO_DOMAIN, "%s",
- _("no domain with matching uuid"));
+ virReportError(VIR_ERR_NO_DOMAIN, "%s",
+ _("no domain with matching uuid"));
goto cleanup;
}
vmwareSetSentinal(cmd, vmw_types[driver->type]);
vmwareSetSentinal(cmd, ((vmwareDomainPtr) vm->privateData)->vmxPath);
if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_PAUSED) {
- vmwareError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("domain is not in suspend state"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("domain is not in suspend state"));
goto cleanup;
}
vmwareDriverUnlock(driver);
if (!vm) {
- vmwareError(VIR_ERR_NO_DOMAIN, "%s",
- _("no domain with matching uuid"));
+ virReportError(VIR_ERR_NO_DOMAIN, "%s",
+ _("no domain with matching uuid"));
goto cleanup;
}
goto cleanup;
if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_RUNNING) {
- vmwareError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("domain is not in running state"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("domain is not in running state"));
goto cleanup;
}
/* create vmx file */
if (virFileWriteStr(vmxPath, vmx, S_IRUSR|S_IWUSR) < 0) {
- vmwareError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to write vmx file '%s'"), vmxPath);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Failed to write vmx file '%s'"), vmxPath);
goto cleanup;
}
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- vmwareError(VIR_ERR_NO_DOMAIN,
- _("No domain with matching uuid '%s'"), uuidstr);
+ virReportError(VIR_ERR_NO_DOMAIN,
+ _("No domain with matching uuid '%s'"), uuidstr);
goto cleanup;
}
goto cleanup;
if (virDomainObjIsActive(vm)) {
- vmwareError(VIR_ERR_OPERATION_INVALID,
- "%s", _("Domain is already running"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("Domain is already running"));
goto cleanup;
}
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- vmwareError(VIR_ERR_NO_DOMAIN,
- _("no domain with matching uuid '%s'"), uuidstr);
+ virReportError(VIR_ERR_NO_DOMAIN,
+ _("no domain with matching uuid '%s'"), uuidstr);
goto cleanup;
}
if (!vm->persistent) {
- vmwareError(VIR_ERR_OPERATION_INVALID,
- "%s", _("cannot undefine transient domain"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("cannot undefine transient domain"));
goto cleanup;
}
vmwareDriverUnlock(driver);
if (!vm) {
- vmwareError(VIR_ERR_NO_DOMAIN, NULL);
+ virReportError(VIR_ERR_NO_DOMAIN, NULL);
goto cleanup;
}
vmwareDriverUnlock(driver);
if (!vm) {
- vmwareError(VIR_ERR_NO_DOMAIN, NULL);
+ virReportError(VIR_ERR_NO_DOMAIN, NULL);
goto cleanup;
}
vmwareDriverUnlock(driver);
if (!vm) {
- vmwareError(VIR_ERR_NO_DOMAIN, NULL);
+ virReportError(VIR_ERR_NO_DOMAIN, NULL);
goto cleanup;
}
vmwareDriverUnlock(driver);
if (!vm) {
- vmwareError(VIR_ERR_NO_DOMAIN, NULL);
+ virReportError(VIR_ERR_NO_DOMAIN, NULL);
goto cleanup;
}
obj = virDomainFindByUUID(&driver->domains, dom->uuid);
vmwareDriverUnlock(driver);
if (!obj) {
- vmwareError(VIR_ERR_NO_DOMAIN, NULL);
+ virReportError(VIR_ERR_NO_DOMAIN, NULL);
goto cleanup;
}
ret = virDomainObjIsActive(obj);
obj = virDomainFindByUUID(&driver->domains, dom->uuid);
vmwareDriverUnlock(driver);
if (!obj) {
- vmwareError(VIR_ERR_NO_DOMAIN, NULL);
+ virReportError(VIR_ERR_NO_DOMAIN, NULL);
goto cleanup;
}
ret = obj->persistent;
vmwareDriverUnlock(driver);
if (!vm) {
- vmwareError(VIR_ERR_NO_DOMAIN, "%s",
- _("no domain with matching uuid"));
+ virReportError(VIR_ERR_NO_DOMAIN, "%s",
+ _("no domain with matching uuid"));
goto cleanup;
}
virCheckFlags(0, NULL);
if (STRNEQ(nativeFormat, "vmware-vmx")) {
- vmwareError(VIR_ERR_INVALID_ARG,
- _("Unsupported config format '%s'"), nativeFormat);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("Unsupported config format '%s'"), nativeFormat);
return NULL;
}
vmwareDriverUnlock(driver);
if (!vm) {
- vmwareError(VIR_ERR_NO_DOMAIN, "%s",
- _("no domain with matching uuid"));
+ virReportError(VIR_ERR_NO_DOMAIN, "%s",
+ _("no domain with matching uuid"));
goto cleanup;
}
vmwareDriverUnlock(driver);
if (!vm) {
- vmwareError(VIR_ERR_NO_DOMAIN, "%s",
- _("no domain with matching uuid"));
+ virReportError(VIR_ERR_NO_DOMAIN, "%s",
+ _("no domain with matching uuid"));
goto cleanup;
}