/* If path isn't '/' then they typoed, tell them correct path */
if (conn->uri->path != NULL &&
STRNEQ(conn->uri->path, "/")) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected LXC URI path '%s', try lxc:///"),
- conn->uri->path);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unexpected LXC URI path '%s', try lxc:///"),
+ conn->uri->path);
return VIR_DRV_OPEN_ERROR;
}
/* URI was good, but driver isn't active */
if (lxc_driver == NULL) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("lxc state driver is not active"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("lxc state driver is not active"));
return VIR_DRV_OPEN_ERROR;
}
}
lxcDriverUnlock(driver);
if (!vm) {
- lxcError(VIR_ERR_NO_DOMAIN,
- _("No domain with matching id %d"), id);
+ virReportError(VIR_ERR_NO_DOMAIN,
+ _("No domain with matching id %d"), id);
goto cleanup;
}
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(uuid, uuidstr);
- lxcError(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;
}
vm = virDomainFindByName(&driver->domains, name);
lxcDriverUnlock(driver);
if (!vm) {
- lxcError(VIR_ERR_NO_DOMAIN,
- _("No domain with matching name '%s'"), name);
+ virReportError(VIR_ERR_NO_DOMAIN,
+ _("No domain with matching name '%s'"), name);
goto cleanup;
}
if (!obj) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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;
}
ret = virDomainObjIsActive(obj);
if (!obj) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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;
}
ret = obj->persistent;
if (!obj) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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;
}
ret = obj->updated;
goto cleanup;
if ((def->nets != NULL) && !(driver->have_netns)) {
- lxcError(VIR_ERR_OPERATION_INVALID,
- "%s", _("System lacks NETNS support"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("System lacks NETNS support"));
goto cleanup;
}
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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) {
- lxcError(VIR_ERR_OPERATION_INVALID,
- "%s", _("Cannot undefine transient domain"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("Cannot undefine transient domain"));
goto cleanup;
}
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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;
}
info->memory = vm->def->mem.cur_balloon;
} else {
if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to get cgroup for %s"), vm->def->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to get cgroup for %s"), vm->def->name);
goto cleanup;
}
if (virCgroupGetCpuacctUsage(cgroup, &(info->cpuTime)) < 0) {
- lxcError(VIR_ERR_OPERATION_FAILED,
- "%s", _("Cannot read cputime for domain"));
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ "%s", _("Cannot read cputime for domain"));
goto cleanup;
}
if ((rc = virCgroupGetMemoryUsage(cgroup, &(info->memory))) < 0) {
- lxcError(VIR_ERR_OPERATION_FAILED,
- "%s", _("Cannot read memory usage for domain"));
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ "%s", _("Cannot read memory usage for domain"));
if (rc == -ENOENT) {
/* Don't fail if we can't read memory usage due to a lack of
* kernel support */
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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 (newmax < vm->def->mem.cur_balloon) {
- lxcError(VIR_ERR_INVALID_ARG,
- "%s", _("Cannot set max memory lower than current memory"));
+ virReportError(VIR_ERR_INVALID_ARG,
+ "%s", _("Cannot set max memory lower than current memory"));
goto cleanup;
}
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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 (newmem > vm->def->mem.max_balloon) {
- lxcError(VIR_ERR_INVALID_ARG,
- "%s", _("Cannot set memory higher than max memory"));
+ virReportError(VIR_ERR_INVALID_ARG,
+ "%s", _("Cannot set memory higher than max memory"));
goto cleanup;
}
if (!virDomainObjIsActive(vm)) {
- lxcError(VIR_ERR_OPERATION_INVALID,
- "%s", _("Domain is not running"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("Domain is not running"));
goto cleanup;
}
if (driver->cgroup == NULL) {
- lxcError(VIR_ERR_OPERATION_INVALID,
- "%s", _("cgroups must be configured on the host"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("cgroups must be configured on the host"));
goto cleanup;
}
if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to get cgroup for %s"), vm->def->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to get cgroup for %s"), vm->def->name);
goto cleanup;
}
if (virCgroupSetMemory(cgroup, newmem) < 0) {
- lxcError(VIR_ERR_OPERATION_FAILED,
- "%s", _("Failed to set memory for domain"));
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ "%s", _("Failed to set memory for domain"));
goto cleanup;
}
if (vm == NULL) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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 (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("cannot find cgroup for domain %s"), vm->def->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot find cgroup for domain %s"), vm->def->name);
goto cleanup;
}
if (vm == NULL) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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 (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("Unable to get cgroup for %s"), vm->def->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to get cgroup for %s"), vm->def->name);
goto cleanup;
}
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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->def->nets != NULL) && !(driver->have_netns)) {
- lxcError(VIR_ERR_OPERATION_INVALID,
- "%s", _("System lacks NETNS support"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("System lacks NETNS support"));
goto cleanup;
}
if (virDomainObjIsActive(vm)) {
- lxcError(VIR_ERR_OPERATION_INVALID,
- "%s", _("Domain is already running"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("Domain is already running"));
goto cleanup;
}
goto cleanup;
if ((def->nets != NULL) && !(driver->have_netns)) {
- lxcError(VIR_ERR_CONFIG_UNSUPPORTED,
- "%s", _("System lacks NETNS support"));
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ "%s", _("System lacks NETNS support"));
goto cleanup;
}
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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 (!virDomainVirtTypeToString(vm->def->virtType)) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("unknown virt type in domain definition '%d'"),
- vm->def->virtType);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("unknown virt type in domain definition '%d'"),
+ vm->def->virtType);
goto cleanup;
}
if (virDomainObjIsActive(vm)) {
if (virSecurityManagerGetProcessLabel(driver->securityManager,
vm->def, vm->pid, seclabel) < 0) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Failed to get security label"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Failed to get security label"));
goto cleanup;
}
}
if (!virStrcpy(secmodel->model, driver->caps->host.secModel.model,
VIR_SECURITY_MODEL_BUFLEN)) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("security model string exceeds max %d bytes"),
- VIR_SECURITY_MODEL_BUFLEN - 1);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("security model string exceeds max %d bytes"),
+ VIR_SECURITY_MODEL_BUFLEN - 1);
ret = -1;
goto cleanup;
}
if (!virStrcpy(secmodel->doi, driver->caps->host.secModel.doi,
VIR_SECURITY_DOI_BUFLEN)) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("security DOI string exceeds max %d bytes"),
- VIR_SECURITY_DOI_BUFLEN-1);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("security DOI string exceeds max %d bytes"),
+ VIR_SECURITY_DOI_BUFLEN-1);
ret = -1;
goto cleanup;
}
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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 (!virDomainObjIsActive(vm)) {
- lxcError(VIR_ERR_OPERATION_INVALID,
- "%s", _("Domain is not running"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("Domain is not running"));
goto cleanup;
}
uname(&ver);
if (virParseVersionString(ver.release, version, true) < 0) {
- lxcError(VIR_ERR_INTERNAL_ERROR, _("Unknown release: %s"), ver.release);
+ virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown release: %s"), ver.release);
return -1;
}
lxcDriverLock(driver);
if (!lxcCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) {
- lxcError(VIR_ERR_OPERATION_INVALID,
- "%s", _("cgroup CPU controller is not mounted"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("cgroup CPU controller is not mounted"));
goto cleanup;
}
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
if (vm == NULL) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("No such domain %s"), dom->uuid);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("No such domain %s"), dom->uuid);
goto cleanup;
}
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
if (!lxcCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) {
- lxcError(VIR_ERR_OPERATION_INVALID,
- "%s", _("cgroup CPU controller is not mounted"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("cgroup CPU controller is not mounted"));
goto cleanup;
}
if (virCgroupForDomain(driver->cgroup, vm->def->name, &group, 0) != 0) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("cannot find cgroup for domain %s"),
- vm->def->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot find cgroup for domain %s"),
+ vm->def->name);
goto cleanup;
}
}
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
if (vm == NULL) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("No such domain %s"), dom->uuid);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("No such domain %s"), dom->uuid);
goto cleanup;
}
}
if (!lxcCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPU)) {
- lxcError(VIR_ERR_OPERATION_INVALID,
- "%s", _("cgroup CPU controller is not mounted"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("cgroup CPU controller is not mounted"));
goto cleanup;
}
if (virCgroupForDomain(driver->cgroup, vm->def->name, &group, 0) != 0) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("cannot find cgroup for domain %s"), vm->def->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot find cgroup for domain %s"), vm->def->name);
goto cleanup;
}
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
if (vm == NULL) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("No such domain %s"), dom->uuid);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("No such domain %s"), dom->uuid);
goto cleanup;
}
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
if (!lxcCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_BLKIO)) {
- lxcError(VIR_ERR_OPERATION_INVALID, "%s",
- _("blkio cgroup isn't mounted"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("blkio cgroup isn't mounted"));
goto cleanup;
}
if (virCgroupForDomain(driver->cgroup, vm->def->name, &group, 0) != 0) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("cannot find cgroup for domain %s"), vm->def->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot find cgroup for domain %s"), vm->def->name);
goto cleanup;
}
int rc;
if (params[i].value.ui > 1000 || params[i].value.ui < 100) {
- lxcError(VIR_ERR_INVALID_ARG, "%s",
- _("out of blkio weight range."));
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("out of blkio weight range."));
goto cleanup;
}
if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) {
if (params[i].value.ui > 1000 || params[i].value.ui < 100) {
- lxcError(VIR_ERR_INVALID_ARG, "%s",
- _("out of blkio weight range."));
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("out of blkio weight range."));
goto cleanup;
}
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
if (vm == NULL) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("No such domain %s"), dom->uuid);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("No such domain %s"), dom->uuid);
goto cleanup;
}
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
if (!lxcCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_BLKIO)) {
- lxcError(VIR_ERR_OPERATION_INVALID, "%s",
- _("blkio cgroup isn't mounted"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("blkio cgroup isn't mounted"));
goto cleanup;
}
if (virCgroupForDomain(driver->cgroup, vm->def->name, &group, 0) != 0) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("cannot find cgroup for domain %s"), vm->def->name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot find cgroup for domain %s"), vm->def->name);
goto cleanup;
}
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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 (!virDomainObjIsActive(vm)) {
- lxcError(VIR_ERR_OPERATION_INVALID,
- "%s", _("Domain is not running"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("Domain is not running"));
goto cleanup;
}
if (ret == 0)
ret = linuxDomainInterfaceStats(path, stats);
else
- lxcError(VIR_ERR_INVALID_ARG,
- _("Invalid path, '%s' is not a known interface"), path);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("Invalid path, '%s' is not a known interface"), path);
cleanup:
if (vm)
const char *path ATTRIBUTE_UNUSED,
struct _virDomainInterfaceStats *stats ATTRIBUTE_UNUSED)
{
- lxcError(VIR_ERR_NO_SUPPORT, "%s", __FUNCTION__);
+ virReportError(VIR_ERR_NO_SUPPORT, "%s", __FUNCTION__);
return -1;
}
#endif
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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) {
- lxcError(VIR_ERR_OPERATION_INVALID,
- "%s", _("Cannot set autostart for transient domain"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("Cannot set autostart for transient domain"));
goto cleanup;
}
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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 (!virDomainObjIsActive(vm)) {
- lxcError(VIR_ERR_OPERATION_INVALID,
- "%s", _("Domain is not running"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("Domain is not running"));
goto cleanup;
}
if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_PAUSED) {
if (lxcFreezeContainer(driver, vm) < 0) {
- lxcError(VIR_ERR_OPERATION_FAILED,
- "%s", _("Suspend operation failed"));
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ "%s", _("Suspend operation failed"));
goto cleanup;
}
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER);
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
- lxcError(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 (!virDomainObjIsActive(vm)) {
- lxcError(VIR_ERR_OPERATION_INVALID,
- "%s", _("Domain is not running"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("Domain is not running"));
goto cleanup;
}
if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
if (lxcUnfreezeContainer(driver, vm) < 0) {
- lxcError(VIR_ERR_OPERATION_FAILED,
- "%s", _("Resume operation failed"));
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ "%s", _("Resume operation failed"));
goto cleanup;
}
virDomainObjSetState(vm, VIR_DOMAIN_RUNNING,
virUUIDFormat(dom->uuid, uuidstr);
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
if (!vm) {
- lxcError(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 (!virDomainObjIsActive(vm)) {
- lxcError(VIR_ERR_OPERATION_INVALID,
- "%s", _("domain is not running"));
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is not running"));
goto cleanup;
}
}
if (!chr) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("cannot find console device '%s'"),
- dev_name ? dev_name : _("default"));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot find console device '%s'"),
+ dev_name ? dev_name : _("default"));
goto cleanup;
}
if (chr->source.type != VIR_DOMAIN_CHR_TYPE_PTY) {
- lxcError(VIR_ERR_INTERNAL_ERROR,
- _("character device %s is not using a PTY"), dev_name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("character device %s is not using a PTY"), dev_name);
goto cleanup;
}