Replace use of qemuReportError with virReportError

Update the QEMU driver to use virReportError instead of
the qemuReportError custom macro

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2012-07-18 16:22:03 +01:00
parent 4e532f2e3d
commit 3b7399b5c9
16 changed files with 2796 additions and 2798 deletions

1
cfg.mk
View File

@ -517,7 +517,6 @@ msg_gen_function += lxcError
msg_gen_function += libxlError
msg_gen_function += nodeReportError
msg_gen_function += openvzError
msg_gen_function += qemuReportError
msg_gen_function += regerror
msg_gen_function += remoteError
msg_gen_function += statsError

View File

@ -204,22 +204,22 @@ qemuAgentOpenUnix(const char *monitor, pid_t cpid, bool *inProgress)
}
if (virSetNonBlock(monfd) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to put monitor into non-blocking mode"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to put monitor into non-blocking mode"));
goto error;
}
if (virSetCloseExec(monfd) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to set monitor close-on-exec flag"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to set monitor close-on-exec flag"));
goto error;
}
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
if (virStrcpyStatic(addr.sun_path, monitor) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Agent path %s too big for destination"), monitor);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Agent path %s too big for destination"), monitor);
goto error;
}
@ -269,14 +269,14 @@ qemuAgentOpenPty(const char *monitor)
int monfd;
if ((monfd = open(monitor, O_RDWR | O_NONBLOCK)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to open monitor path %s"), monitor);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to open monitor path %s"), monitor);
return -1;
}
if (virSetCloseExec(monfd) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to set monitor close-on-exec flag"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to set monitor close-on-exec flag"));
goto error;
}
@ -331,8 +331,8 @@ qemuAgentIOProcessLine(qemuAgentPtr mon,
goto cleanup;
if (obj->type != VIR_JSON_TYPE_OBJECT) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Parsed JSON reply '%s' isn't an object"), line);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Parsed JSON reply '%s' isn't an object"), line);
goto cleanup;
}
@ -362,12 +362,12 @@ qemuAgentIOProcessLine(qemuAgentPtr mon,
goto cleanup;
}
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unexpected JSON reply '%s'"), line);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unexpected JSON reply '%s'"), line);
}
} else {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown JSON reply '%s'"), line);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown JSON reply '%s'"), line);
}
cleanup:
@ -609,9 +609,9 @@ qemuAgentIO(int watch, int fd, int events, void *opaque) {
if (mon->fd != fd || mon->watch != watch) {
if (events & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR))
eof = true;
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("event from unexpected fd %d!=%d / watch %d!=%d"),
mon->fd, fd, mon->watch, watch);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("event from unexpected fd %d!=%d / watch %d!=%d"),
mon->fd, fd, mon->watch, watch);
error = true;
} else if (mon->lastError.code != VIR_ERR_OK) {
if (events & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR))
@ -649,23 +649,23 @@ qemuAgentIO(int watch, int fd, int events, void *opaque) {
if (!error &&
events & VIR_EVENT_HANDLE_HANGUP) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("End of file from monitor"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("End of file from monitor"));
eof = 1;
events &= ~VIR_EVENT_HANDLE_HANGUP;
}
if (!error && !eof &&
events & VIR_EVENT_HANDLE_ERROR) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Invalid file descriptor while waiting for monitor"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Invalid file descriptor while waiting for monitor"));
eof = 1;
events &= ~VIR_EVENT_HANDLE_ERROR;
}
if (!error && events) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unhandled event %d for monitor fd %d"),
events, mon->fd);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unhandled event %d for monitor fd %d"),
events, mon->fd);
error = 1;
}
}
@ -677,8 +677,8 @@ qemuAgentIO(int watch, int fd, int events, void *opaque) {
} else {
virErrorPtr err = virGetLastError();
if (!err)
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Error while processing monitor IO"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Error while processing monitor IO"));
virCopyLastError(&mon->lastError);
virResetLastError();
}
@ -734,8 +734,8 @@ qemuAgentOpen(virDomainObjPtr vm,
qemuAgentPtr mon;
if (!cb || !cb->eofNotify) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("EOF notify callback must be supplied"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("EOF notify callback must be supplied"));
return NULL;
}
@ -745,14 +745,14 @@ qemuAgentOpen(virDomainObjPtr vm,
}
if (virMutexInit(&mon->lock) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot initialize monitor mutex"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot initialize monitor mutex"));
VIR_FREE(mon);
return NULL;
}
if (virCondInit(&mon->notify) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot initialize monitor condition"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot initialize monitor condition"));
virMutexDestroy(&mon->lock);
VIR_FREE(mon);
return NULL;
@ -774,9 +774,9 @@ qemuAgentOpen(virDomainObjPtr vm,
break;
default:
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to handle monitor type: %s"),
virDomainChrTypeToString(config->type));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to handle monitor type: %s"),
virDomainChrTypeToString(config->type));
goto cleanup;
}
@ -792,8 +792,8 @@ qemuAgentOpen(virDomainObjPtr vm,
0),
qemuAgentIO,
mon, qemuAgentUnwatch)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("unable to register monitor events"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("unable to register monitor events"));
goto cleanup;
}
qemuAgentRef(mon);
@ -886,12 +886,12 @@ static int qemuAgentSend(qemuAgentPtr mon,
if ((timeout && virCondWaitUntil(&mon->notify, &mon->lock, then) < 0) ||
(!timeout && virCondWait(&mon->notify, &mon->lock) < 0)) {
if (errno == ETIMEDOUT) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Guest agent not available for now"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Guest agent not available for now"));
ret = -2;
} else {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to wait on monitor condition"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to wait on monitor condition"));
}
goto cleanup;
}
@ -959,23 +959,23 @@ qemuAgentGuestSync(qemuAgentPtr mon)
}
if (!sync_msg.rxObject) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing monitor reply object"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing monitor reply object"));
goto cleanup;
}
if (virJSONValueObjectGetNumberUlong(sync_msg.rxObject,
"return", &id_ret) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Malformed return value"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Malformed return value"));
goto cleanup;
}
VIR_DEBUG("Guest returned ID: %llu", id_ret);
if (id_ret != id) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Guest agent returned ID: %llu instead of %llu"),
id_ret, id);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Guest agent returned ID: %llu instead of %llu"),
id_ret, id);
goto cleanup;
}
ret = 0;
@ -1029,8 +1029,8 @@ qemuAgentCommand(qemuAgentPtr mon,
if (await_event) {
VIR_DEBUG("Woken up by event %d", await_event);
} else {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing monitor reply object"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing monitor reply object"));
ret = -1;
}
} else {
@ -1128,14 +1128,14 @@ qemuAgentCheckError(virJSONValuePtr cmd,
/* Only send the user the command name + friendly error */
if (!error)
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to execute QEMU command '%s'"),
qemuAgentCommandName(cmd));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to execute QEMU command '%s'"),
qemuAgentCommandName(cmd));
else
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to execute QEMU command '%s': %s"),
qemuAgentCommandName(cmd),
qemuAgentStringifyError(error));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to execute QEMU command '%s': %s"),
qemuAgentCommandName(cmd),
qemuAgentStringifyError(error));
VIR_FREE(cmdstr);
VIR_FREE(replystr);
@ -1146,9 +1146,9 @@ qemuAgentCheckError(virJSONValuePtr cmd,
VIR_DEBUG("Neither 'return' nor 'error' is set in the JSON reply %s: %s",
cmdstr, replystr);
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to execute QEMU command '%s'"),
qemuAgentCommandName(cmd));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to execute QEMU command '%s'"),
qemuAgentCommandName(cmd));
VIR_FREE(cmdstr);
VIR_FREE(replystr);
return -1;
@ -1178,9 +1178,9 @@ qemuAgentMakeCommand(const char *cmdname,
char type;
if (strlen(key) < 3) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("argument key '%s' is too short, missing type prefix"),
key);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("argument key '%s' is too short, missing type prefix"),
key);
goto error;
}
@ -1232,8 +1232,8 @@ qemuAgentMakeCommand(const char *cmdname,
ret = virJSONValueObjectAppendNull(jargs, key);
} break;
default:
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("unsupported data type '%c' for arg '%s'"), type, key - 2);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unsupported data type '%c' for arg '%s'"), type, key - 2);
goto error;
}
if (ret < 0)
@ -1332,8 +1332,8 @@ int qemuAgentFSFreeze(qemuAgentPtr mon)
goto cleanup;
if (virJSONValueObjectGetNumberInt(reply, "return", &ret) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("malformed return value"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("malformed return value"));
}
cleanup:
@ -1369,8 +1369,8 @@ int qemuAgentFSThaw(qemuAgentPtr mon)
goto cleanup;
if (virJSONValueObjectGetNumberInt(reply, "return", &ret) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("malformed return value"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("malformed return value"));
}
cleanup:

View File

@ -1226,9 +1226,9 @@ qemuCapsComputeCmdFlags(const char *help,
if (version >= 15000 ||
(version >= 12000 && strstr(help, "libvirt"))) {
if (check_yajl) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("this qemu binary requires libvirt to be "
"compiled with yajl"));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("this qemu binary requires libvirt to be "
"compiled with yajl"));
return -1;
}
qemuCapsSet(flags, QEMU_CAPS_NETDEV);
@ -1363,9 +1363,9 @@ fail:
if (!p)
p = strchr(help, '\0');
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse %s version number in '%.*s'"),
qemu, (int) (p - help), help);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse %s version number in '%.*s'"),
qemu, (int) (p - help), help);
cleanup:
return -1;
@ -1589,8 +1589,8 @@ int qemuCapsExtractVersion(virCapsPtr caps,
"hvm",
ut.machine,
"qemu")) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot find suitable emulator for %s"), ut.machine);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Cannot find suitable emulator for %s"), ut.machine);
return -1;
}

View File

@ -310,8 +310,8 @@ int qemuSetupCgroup(struct qemud_driver *driver,
goto cleanup;
}
} else {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Block I/O tuning is not available on this host"));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Block I/O tuning is not available on this host"));
goto cleanup;
}
}
@ -333,8 +333,8 @@ int qemuSetupCgroup(struct qemud_driver *driver,
}
}
} else {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Block I/O tuning is not available on this host"));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Block I/O tuning is not available on this host"));
goto cleanup;
}
}
@ -372,8 +372,8 @@ int qemuSetupCgroup(struct qemud_driver *driver,
}
}
} else {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Memory cgroup is not available on this host"));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Memory cgroup is not available on this host"));
}
}
@ -387,8 +387,8 @@ int qemuSetupCgroup(struct qemud_driver *driver,
goto cleanup;
}
} else {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("CPU tuning is not available on this host"));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("CPU tuning is not available on this host"));
}
}
@ -405,8 +405,8 @@ int qemuSetupCgroup(struct qemud_driver *driver,
mask = virDomainCpuSetFormat(vm->def->numatune.memory.nodemask,
VIR_DOMAIN_CPUMASK_LEN);
if (!mask) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("failed to convert memory nodemask"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("failed to convert memory nodemask"));
goto cleanup;
}
@ -585,9 +585,9 @@ int qemuRemoveCgroup(struct qemud_driver *driver,
rc = virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0);
if (rc != 0) {
if (!quiet)
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find cgroup for %s"),
vm->def->name);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find cgroup for %s"),
vm->def->name);
return rc;
}

File diff suppressed because it is too large Load Diff

View File

@ -140,9 +140,9 @@ int qemudLoadDriverConfig(struct qemud_driver *driver,
#define CHECK_TYPE(name,typ) if (p && p->type != (typ)) { \
qemuReportError(VIR_ERR_INTERNAL_ERROR, \
"%s: %s: expected type " #typ, \
filename, (name)); \
virReportError(VIR_ERR_INTERNAL_ERROR, \
"%s: %s: expected type " #typ, \
filename, (name)); \
virConfFree(conf); \
return -1; \
}
@ -535,16 +535,16 @@ qemuDriverCloseCallbackSet(struct qemud_driver *driver,
closeDef = virHashLookup(driver->closeCallbacks, uuidstr);
if (closeDef) {
if (closeDef->conn != conn) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Close callback for domain %s already registered"
" with another connection %p"),
vm->def->name, closeDef->conn);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Close callback for domain %s already registered"
" with another connection %p"),
vm->def->name, closeDef->conn);
return -1;
}
if (closeDef->cb && closeDef->cb != cb) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Another close callback is already defined for"
" domain %s"), vm->def->name);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Another close callback is already defined for"
" domain %s"), vm->def->name);
return -1;
}
@ -582,9 +582,9 @@ qemuDriverCloseCallbackUnset(struct qemud_driver *driver,
return -1;
if (closeDef->cb && closeDef->cb != cb) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Trying to remove mismatching close callback for"
" domain %s"), vm->def->name);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Trying to remove mismatching close callback for"
" domain %s"), vm->def->name);
return -1;
}

View File

@ -167,10 +167,6 @@ struct _qemuDomainCmdlineDef {
# define QEMUD_MIGRATION_FIRST_PORT 49152
# define QEMUD_MIGRATION_NUM_PORTS 64
# define qemuReportError(code, ...) \
virReportErrorHelper(VIR_FROM_QEMU, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__)
void qemuDriverLock(struct qemud_driver *driver);
void qemuDriverUnlock(struct qemud_driver *driver);

View File

@ -344,8 +344,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
if (!(monitorpath =
virXPathString("string(./monitor[1]/@path)", ctxt))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("no monitor path"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("no monitor path"));
goto error;
}
@ -371,9 +371,9 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
break;
default:
VIR_FREE(monitorpath);
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("unsupported monitor type '%s'"),
virDomainChrTypeToString(priv->monConfig->type));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unsupported monitor type '%s'"),
virDomainChrTypeToString(priv->monConfig->type));
goto error;
}
@ -402,8 +402,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
}
if ((n = virXPathNodeSet("./qemuCaps/flag", ctxt, &nodes)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("failed to parse qemu capabilities flags"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("failed to parse qemu capabilities flags"));
goto error;
}
if (n > 0) {
@ -415,8 +415,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
if (str) {
int flag = qemuCapsTypeFromString(str);
if (flag < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown qemu capabilities flag %s"), str);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown qemu capabilities flag %s"), str);
VIR_FREE(str);
goto error;
}
@ -435,8 +435,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
int type;
if ((type = qemuDomainJobTypeFromString(tmp)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown job type %s"), tmp);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown job type %s"), tmp);
VIR_FREE(tmp);
goto error;
}
@ -448,8 +448,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
int async;
if ((async = qemuDomainAsyncJobTypeFromString(tmp)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown async job type %s"), tmp);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown async job type %s"), tmp);
VIR_FREE(tmp);
goto error;
}
@ -459,8 +459,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
if ((tmp = virXPathString("string(./job[1]/@phase)", ctxt))) {
priv->job.phase = qemuDomainAsyncJobPhaseFromString(async, tmp);
if (priv->job.phase < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown job phase %s"), tmp);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown job phase %s"), tmp);
VIR_FREE(tmp);
goto error;
}
@ -514,9 +514,9 @@ qemuDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED,
int n, i;
if (xmlXPathRegisterNs(ctxt, BAD_CAST "qemu", BAD_CAST QEMU_NAMESPACE_HREF) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to register xml namespace '%s'"),
QEMU_NAMESPACE_HREF);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to register xml namespace '%s'"),
QEMU_NAMESPACE_HREF);
return -1;
}
@ -537,8 +537,8 @@ qemuDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED,
for (i = 0; i < n; i++) {
cmd->args[cmd->num_args] = virXMLPropString(nodes[i], "value");
if (cmd->args[cmd->num_args] == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("No qemu command-line argument specified"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("No qemu command-line argument specified"));
goto error;
}
cmd->num_args++;
@ -563,23 +563,23 @@ qemuDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED,
tmp = virXMLPropString(nodes[i], "name");
if (tmp == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("No qemu environment name specified"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("No qemu environment name specified"));
goto error;
}
if (tmp[0] == '\0') {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Empty qemu environment name specified"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Empty qemu environment name specified"));
goto error;
}
if (!c_isalpha(tmp[0]) && tmp[0] != '_') {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Invalid environment name, it must begin with a letter or underscore"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Invalid environment name, it must begin with a letter or underscore"));
goto error;
}
if (strspn(tmp, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_") != strlen(tmp)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Invalid environment name, it must contain only alphanumerics and underscore"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Invalid environment name, it must contain only alphanumerics and underscore"));
goto error;
}
@ -838,13 +838,13 @@ error:
priv->job.owner, priv->job.asyncOwner);
if (errno == ETIMEDOUT)
qemuReportError(VIR_ERR_OPERATION_TIMEOUT,
"%s", _("cannot acquire state change lock"));
virReportError(VIR_ERR_OPERATION_TIMEOUT,
"%s", _("cannot acquire state change lock"));
else if (driver->max_queued &&
priv->jobs_queued > driver->max_queued)
qemuReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("cannot acquire state change lock "
"due to max_queued limit"));
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("cannot acquire state change lock "
"due to max_queued limit"));
else
virReportSystemError(errno,
"%s", _("cannot acquire job mutex"));
@ -899,8 +899,8 @@ int qemuDomainObjBeginJobWithDriver(struct qemud_driver *driver,
enum qemuDomainJob job)
{
if (job <= QEMU_JOB_NONE || job >= QEMU_JOB_ASYNC) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Attempt to start invalid job"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Attempt to start invalid job"));
return -1;
}
@ -971,8 +971,8 @@ qemuDomainObjEnterMonitorInternal(struct qemud_driver *driver,
if (asyncJob != QEMU_ASYNC_JOB_NONE) {
if (asyncJob != priv->job.asyncJob) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected async job %d"), asyncJob);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected async job %d"), asyncJob);
return -1;
}
if (priv->job.asyncOwner != virThreadSelfID())
@ -983,8 +983,8 @@ qemuDomainObjEnterMonitorInternal(struct qemud_driver *driver,
QEMU_ASYNC_JOB_NONE) < 0)
return -1;
if (!virDomainObjIsActive(obj)) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("domain is no longer running"));
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("domain is no longer running"));
/* Still referenced by the containing async job. */
ignore_value(qemuDomainObjEndJob(driver, obj));
return -1;
@ -1241,8 +1241,8 @@ qemuDomainDefFormatBuf(struct qemud_driver *driver,
def_cpu &&
(def_cpu->mode != VIR_CPU_MODE_CUSTOM || def_cpu->model)) {
if (!driver->caps || !driver->caps->host.cpu) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("cannot get host CPU capabilities"));
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("cannot get host CPU capabilities"));
goto cleanup;
}
@ -1575,8 +1575,8 @@ qemuFindQemuImgBinary(struct qemud_driver *driver)
if (!driver->qemuImgBinary)
driver->qemuImgBinary = virFindFileInPath("qemu-img");
if (!driver->qemuImgBinary)
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("unable to find kvm-img or qemu-img"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("unable to find kvm-img or qemu-img"));
}
return driver->qemuImgBinary;
@ -1672,10 +1672,10 @@ qemuDomainSnapshotForEachQcow2Raw(struct qemud_driver *driver,
qemuDomainSnapshotForEachQcow2Raw(driver, def, name,
"-d", false, i);
}
qemuReportError(VIR_ERR_OPERATION_INVALID,
_("Disk device '%s' does not support"
" snapshotting"),
def->disks[i]->dst);
virReportError(VIR_ERR_OPERATION_INVALID,
_("Disk device '%s' does not support"
" snapshotting"),
def->disks[i]->dst);
return -1;
}

File diff suppressed because it is too large Load Diff

View File

@ -31,6 +31,8 @@
#include "hostusb.h"
#include "virnetdev.h"
#define VIR_FROM_THIS VIR_FROM_QEMU
static pciDeviceList *
qemuGetPciHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs)
{
@ -271,10 +273,11 @@ qemuDomainHostdevNetConfigVirtPortProfile(const char *linkdev, int vf,
case VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH:
case VIR_NETDEV_VPORT_PROFILE_8021QBG:
case VIR_NETDEV_VPORT_PROFILE_LAST:
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("virtualport type %s is "
"currently not supported on interfaces of type "
"hostdev"),
virNetDevVPortTypeToString(virtPort->virtPortType));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("virtualport type %s is "
"currently not supported on interfaces of type "
"hostdev"),
virNetDevVPortTypeToString(virtPort->virtPortType));
break;
case VIR_NETDEV_VPORT_PROFILE_8021QBH:
@ -307,9 +310,9 @@ qemuDomainHostdevNetConfigReplace(virDomainHostdevDefPtr hostdev,
isvf = qemuDomainHostdevIsVirtualFunction(hostdev);
if (isvf <= 0) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Interface type hostdev is currently supported on"
" SR-IOV Virtual Functions only"));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Interface type hostdev is currently supported on"
" SR-IOV Virtual Functions only"));
return ret;
}
@ -345,9 +348,9 @@ qemuDomainHostdevNetConfigRestore(virDomainHostdevDefPtr hostdev,
isvf = qemuDomainHostdevIsVirtualFunction(hostdev);
if (isvf <= 0) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Interface type hostdev is currently supported on"
" SR-IOV Virtual Functions only"));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Interface type hostdev is currently supported on"
" SR-IOV Virtual Functions only"));
return ret;
}
@ -399,9 +402,9 @@ int qemuPrepareHostdevPCIDevices(struct qemud_driver *driver,
pciDevice *other;
if (!pciDeviceIsAssignable(dev, !driver->relaxedACS)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
_("PCI device %s is not assignable"),
pciDeviceGetName(dev));
virReportError(VIR_ERR_OPERATION_INVALID,
_("PCI device %s is not assignable"),
pciDeviceGetName(dev));
goto cleanup;
}
/* The device is in use by other active domain if
@ -411,13 +414,13 @@ int qemuPrepareHostdevPCIDevices(struct qemud_driver *driver,
const char *other_name = pciDeviceGetUsedBy(other);
if (other_name)
qemuReportError(VIR_ERR_OPERATION_INVALID,
_("PCI device %s is in use by domain %s"),
pciDeviceGetName(dev), other_name);
virReportError(VIR_ERR_OPERATION_INVALID,
_("PCI device %s is in use by domain %s"),
pciDeviceGetName(dev), other_name);
else
qemuReportError(VIR_ERR_OPERATION_INVALID,
_("PCI device %s is already in use"),
pciDeviceGetName(dev));
virReportError(VIR_ERR_OPERATION_INVALID,
_("PCI device %s is already in use"),
pciDeviceGetName(dev));
goto cleanup;
}
}
@ -579,13 +582,13 @@ qemuPrepareHostdevUSBDevices(struct qemud_driver *driver,
const char *other_name = usbDeviceGetUsedBy(tmp);
if (other_name)
qemuReportError(VIR_ERR_OPERATION_INVALID,
_("USB device %s is in use by domain %s"),
usbDeviceGetName(tmp), other_name);
virReportError(VIR_ERR_OPERATION_INVALID,
_("USB device %s is in use by domain %s"),
usbDeviceGetName(tmp), other_name);
else
qemuReportError(VIR_ERR_OPERATION_INVALID,
_("USB device %s is already in use"),
usbDeviceGetName(tmp));
virReportError(VIR_ERR_OPERATION_INVALID,
_("USB device %s is already in use"),
usbDeviceGetName(tmp));
goto error;
}
@ -653,9 +656,9 @@ qemuPrepareHostUSBDevices(struct qemud_driver *driver,
goto cleanup;
if (usbDeviceListCount(devs) > 1) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("multiple USB devices for %x:%x, "
"use <address> to specify one"), vendor, product);
virReportError(VIR_ERR_OPERATION_FAILED,
_("multiple USB devices for %x:%x, "
"use <address> to specify one"), vendor, product);
usbDeviceListFree(devs);
goto cleanup;
}

View File

@ -66,23 +66,23 @@ int qemuDomainChangeEjectableMedia(struct qemud_driver *driver,
}
if (!origdisk) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("No device with bus '%s' and target '%s'"),
virDomainDiskBusTypeToString(disk->bus),
disk->dst);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("No device with bus '%s' and target '%s'"),
virDomainDiskBusTypeToString(disk->bus),
disk->dst);
return -1;
}
if (!origdisk->info.alias) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("missing disk device alias name for %s"), origdisk->dst);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("missing disk device alias name for %s"), origdisk->dst);
return -1;
}
if (origdisk->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY &&
origdisk->device != VIR_DOMAIN_DISK_DEVICE_CDROM) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Removable media not supported for %s device"),
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Removable media not supported for %s device"),
virDomainDiskDeviceTypeToString(disk->device));
return -1;
}
@ -210,8 +210,8 @@ int qemuDomainAttachPciDiskDevice(virConnectPtr conn,
for (i = 0 ; i < vm->def->ndisks ; i++) {
if (STREQ(vm->def->disks[i]->dst, disk->dst)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("target %s already exists"), disk->dst);
virReportError(VIR_ERR_OPERATION_FAILED,
_("target %s already exists"), disk->dst);
return -1;
}
}
@ -318,9 +318,9 @@ int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver,
for (i = 0 ; i < vm->def->ncontrollers ; i++) {
if ((vm->def->controllers[i]->type == controller->type) &&
(vm->def->controllers[i]->idx == controller->idx)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("target %s:%d already exists"),
type, controller->idx);
virReportError(VIR_ERR_OPERATION_FAILED,
_("target %s:%d already exists"),
type, controller->idx);
return -1;
}
}
@ -335,8 +335,8 @@ int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver,
if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
controller->model == -1 &&
!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("USB controller hotplug unsupported in this QEMU binary"));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("USB controller hotplug unsupported in this QEMU binary"));
goto cleanup;
}
@ -415,8 +415,8 @@ qemuDomainFindOrCreateSCSIDiskController(struct qemud_driver *driver,
}
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
/* cont doesn't need freeing here, since the reference
* now held in def->controllers */
return NULL;
@ -440,8 +440,8 @@ int qemuDomainAttachSCSIDisk(virConnectPtr conn,
for (i = 0 ; i < vm->def->ndisks ; i++) {
if (STREQ(vm->def->disks[i]->dst, disk->dst)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("target %s already exists"), disk->dst);
virReportError(VIR_ERR_OPERATION_FAILED,
_("target %s already exists"), disk->dst);
return -1;
}
}
@ -458,9 +458,9 @@ int qemuDomainAttachSCSIDisk(virConnectPtr conn,
/* We should have an address already, so make sure */
if (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected disk address type %s"),
virDomainDeviceAddressTypeToString(disk->info.type));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected disk address type %s"),
virDomainDeviceAddressTypeToString(disk->info.type));
goto error;
}
@ -486,8 +486,8 @@ int qemuDomainAttachSCSIDisk(virConnectPtr conn,
sa_assert (cont);
if (cont->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("SCSI controller %d was missing its PCI address"), cont->idx);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("SCSI controller %d was missing its PCI address"), cont->idx);
goto error;
}
@ -563,8 +563,8 @@ int qemuDomainAttachUsbMassstorageDevice(virConnectPtr conn,
for (i = 0 ; i < vm->def->ndisks ; i++) {
if (STREQ(vm->def->disks[i]->dst, disk->dst)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("target %s already exists"), disk->dst);
virReportError(VIR_ERR_OPERATION_FAILED,
_("target %s already exists"), disk->dst);
return -1;
}
}
@ -581,8 +581,8 @@ int qemuDomainAttachUsbMassstorageDevice(virConnectPtr conn,
/* XXX not correct once we allow attaching a USB CDROM */
if (!disk->src) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("disk source path is missing"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("disk source path is missing"));
goto error;
}
@ -692,8 +692,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
}
if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_HOST_NET_ADD)) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("installed qemu version does not support host_net_add"));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("installed qemu version does not support host_net_add"));
goto cleanup;
}
@ -734,8 +734,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
vlan = qemuDomainNetVLAN(net);
if (vlan < 0) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Unable to attach network devices without vlan"));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Unable to attach network devices without vlan"));
goto cleanup;
}
}
@ -784,8 +784,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
VIR_FORCE_CLOSE(vhostfd);
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
goto cleanup;
}
@ -820,8 +820,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
/* set link state */
if (net->linkstate == VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN) {
if (!net->info.alias) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("device alias not found: cannot set link state to down"));
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("device alias not found: cannot set link state to down"));
} else {
qemuDomainObjEnterMonitorWithDriver(driver, vm);
@ -832,8 +832,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
goto try_remove;
}
} else {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("setting of link state not supported: Link is up"));
virReportError(VIR_ERR_OPERATION_FAILED,
_("setting of link state not supported: Link is up"));
}
qemuDomainObjExitMonitorWithDriver(driver, vm);
@ -953,8 +953,8 @@ int qemuDomainAttachHostPciDevice(struct qemud_driver *driver,
}
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit during hotplug"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit during hotplug"));
goto error;
}
@ -1077,9 +1077,9 @@ int qemuDomainAttachHostUsbDevice(struct qemud_driver *driver,
qemuCgroupData data;
if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) !=0 ) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find cgroup for %s"),
vm->def->name);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find cgroup for %s"),
vm->def->name);
goto error;
}
@ -1124,9 +1124,9 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver,
usbDevice *usb = NULL;
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("hostdev mode '%s' not supported"),
virDomainHostdevModeTypeToString(hostdev->mode));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("hostdev mode '%s' not supported"),
virDomainHostdevModeTypeToString(hostdev->mode));
return -1;
}
@ -1148,9 +1148,9 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver,
goto cleanup;
if (usbDeviceListCount(devs) > 1) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("multiple USB devices for %x:%x, "
"use <address> to specify one"), vendor, product);
virReportError(VIR_ERR_OPERATION_FAILED,
_("multiple USB devices for %x:%x, "
"use <address> to specify one"), vendor, product);
usbDeviceListFree(devs);
goto cleanup;
}
@ -1199,9 +1199,9 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver,
break;
default:
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("hostdev subsys type '%s' not supported"),
virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("hostdev subsys type '%s' not supported"),
virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type));
goto error;
}
@ -1246,8 +1246,8 @@ int qemuDomainChangeNetBridge(virDomainObjPtr vm,
olddev->ifname, oldbridge, newbridge);
if (virNetDevExists(newbridge) != 1) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("bridge %s doesn't exist"), newbridge);
virReportError(VIR_ERR_OPERATION_FAILED,
_("bridge %s doesn't exist"), newbridge);
return -1;
}
@ -1268,9 +1268,9 @@ int qemuDomainChangeNetBridge(virDomainObjPtr vm,
ret = virNetDevBridgeAddPort(oldbridge, olddev->ifname);
virDomainAuditNet(vm, NULL, olddev, "attach", ret == 0);
if (ret < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("unable to recover former state by adding port"
"to bridge %s"), oldbridge);
virReportError(VIR_ERR_OPERATION_FAILED,
_("unable to recover former state by adding port"
"to bridge %s"), oldbridge);
}
return -1;
}
@ -1291,8 +1291,8 @@ int qemuDomainChangeNetLinkState(struct qemud_driver *driver,
VIR_DEBUG("dev: %s, state: %d", dev->info.alias, linkstate);
if (!dev->info.alias) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("can't change link state: device alias not found"));
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("can't change link state: device alias not found"));
return -1;
}
@ -1321,14 +1321,14 @@ int qemuDomainChangeNet(struct qemud_driver *driver,
int ret = 0;
if (!olddev) {
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot find existing network device to modify"));
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot find existing network device to modify"));
return -1;
}
if (olddev->type != dev->type) {
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot change network interface type"));
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot change network interface type"));
return -1;
}
@ -1340,8 +1340,8 @@ int qemuDomainChangeNet(struct qemud_driver *driver,
if (STRNEQ_NULLABLE(olddev->data.ethernet.dev, dev->data.ethernet.dev) ||
STRNEQ_NULLABLE(olddev->script, dev->script) ||
STRNEQ_NULLABLE(olddev->data.ethernet.ipaddr, dev->data.ethernet.ipaddr)) {
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify ethernet network device configuration"));
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify ethernet network device configuration"));
return -1;
}
break;
@ -1351,8 +1351,8 @@ int qemuDomainChangeNet(struct qemud_driver *driver,
case VIR_DOMAIN_NET_TYPE_MCAST:
if (STRNEQ_NULLABLE(olddev->data.socket.address, dev->data.socket.address) ||
olddev->data.socket.port != dev->data.socket.port) {
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify network socket device configuration"));
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify network socket device configuration"));
return -1;
}
break;
@ -1361,8 +1361,8 @@ int qemuDomainChangeNet(struct qemud_driver *driver,
if (STRNEQ_NULLABLE(olddev->data.network.name, dev->data.network.name) ||
STRNEQ_NULLABLE(olddev->data.network.portgroup, dev->data.network.portgroup) ||
!virNetDevVPortProfileEqual(olddev->data.network.virtPortProfile, dev->data.network.virtPortProfile)) {
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify network device configuration"));
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify network device configuration"));
return -1;
}
@ -1372,16 +1372,16 @@ int qemuDomainChangeNet(struct qemud_driver *driver,
/* allow changing brname, but not portprofile */
if (!virNetDevVPortProfileEqual(olddev->data.bridge.virtPortProfile,
dev->data.bridge.virtPortProfile)) {
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify bridge network device configuration"));
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify bridge network device configuration"));
return -1;
}
break;
case VIR_DOMAIN_NET_TYPE_INTERNAL:
if (STRNEQ_NULLABLE(olddev->data.internal.name, dev->data.internal.name)) {
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify internal network device configuration"));
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify internal network device configuration"));
return -1;
}
break;
@ -1390,16 +1390,16 @@ int qemuDomainChangeNet(struct qemud_driver *driver,
if (STRNEQ_NULLABLE(olddev->data.direct.linkdev, dev->data.direct.linkdev) ||
olddev->data.direct.mode != dev->data.direct.mode ||
!virNetDevVPortProfileEqual(olddev->data.direct.virtPortProfile, dev->data.direct.virtPortProfile)) {
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify direct network device configuration"));
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify direct network device configuration"));
return -1;
}
break;
default:
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to change config on '%s' network type"),
virDomainNetTypeToString(dev->type));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to change config on '%s' network type"),
virDomainNetTypeToString(dev->type));
break;
}
@ -1407,16 +1407,16 @@ int qemuDomainChangeNet(struct qemud_driver *driver,
/* all other unmodifiable parameters */
if (STRNEQ_NULLABLE(olddev->model, dev->model) ||
STRNEQ_NULLABLE(olddev->filter, dev->filter)) {
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify network device configuration"));
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify network device configuration"));
return -1;
}
/* check if device name has been set, if no, retain the autogenerated one */
if (dev->ifname &&
STRNEQ_NULLABLE(olddev->ifname, dev->ifname)) {
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify network device configuration"));
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify network device configuration"));
return -1;
}
@ -1462,8 +1462,8 @@ qemuDomainChangeGraphics(struct qemud_driver *driver,
int ret = -1;
if (!olddev) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot find existing graphics device to modify"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot find existing graphics device to modify"));
return -1;
}
@ -1477,23 +1477,23 @@ qemuDomainChangeGraphics(struct qemud_driver *driver,
if ((olddev->data.vnc.autoport != dev->data.vnc.autoport) ||
(!dev->data.vnc.autoport &&
(olddev->data.vnc.port != dev->data.vnc.port))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot change port settings on vnc graphics"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot change port settings on vnc graphics"));
return -1;
}
if (STRNEQ_NULLABLE(oldListenAddr,newListenAddr)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot change listen address setting on vnc graphics"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot change listen address setting on vnc graphics"));
return -1;
}
if (STRNEQ_NULLABLE(oldListenNetwork,newListenNetwork)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot change listen network setting on vnc graphics"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot change listen network setting on vnc graphics"));
return -1;
}
if (STRNEQ_NULLABLE(olddev->data.vnc.keymap, dev->data.vnc.keymap)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot change keymap setting on vnc graphics"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot change keymap setting on vnc graphics"));
return -1;
}
@ -1530,23 +1530,23 @@ qemuDomainChangeGraphics(struct qemud_driver *driver,
(olddev->data.spice.port != dev->data.spice.port)) ||
(!dev->data.spice.autoport &&
(olddev->data.spice.tlsPort != dev->data.spice.tlsPort))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot change port settings on spice graphics"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot change port settings on spice graphics"));
return -1;
}
if (STRNEQ_NULLABLE(oldListenAddr, newListenAddr)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot change listen address setting on spice graphics"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot change listen address setting on spice graphics"));
return -1;
}
if (STRNEQ_NULLABLE(oldListenNetwork, newListenNetwork)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot change listen network setting on spice graphics"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot change listen network setting on spice graphics"));
return -1;
}
if (STRNEQ_NULLABLE(olddev->data.spice.keymap,
dev->data.spice.keymap)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot change keymap setting on spice graphics"));
return -1;
}
@ -1584,9 +1584,9 @@ qemuDomainChangeGraphics(struct qemud_driver *driver,
break;
default:
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to change config on '%s' graphics type"),
virDomainGraphicsTypeToString(dev->type));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to change config on '%s' graphics type"),
virDomainGraphicsTypeToString(dev->type));
break;
}
@ -1646,33 +1646,33 @@ int qemuDomainDetachPciDiskDevice(struct qemud_driver *driver,
i = qemuFindDisk(vm->def, dev->data.disk->dst);
if (i < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("disk %s not found"), dev->data.disk->dst);
virReportError(VIR_ERR_OPERATION_FAILED,
_("disk %s not found"), dev->data.disk->dst);
goto cleanup;
}
detach = vm->def->disks[i];
if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("cannot hot unplug multifunction PCI device: %s"),
dev->data.disk->dst);
virReportError(VIR_ERR_OPERATION_FAILED,
_("cannot hot unplug multifunction PCI device: %s"),
dev->data.disk->dst);
goto cleanup;
}
if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES)) {
if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find cgroup for %s"),
vm->def->name);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find cgroup for %s"),
vm->def->name);
goto cleanup;
}
}
if (!virDomainDeviceAddressIsValid(&detach->info,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("device cannot be detached without a PCI address"));
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("device cannot be detached without a PCI address"));
goto cleanup;
}
@ -1750,15 +1750,15 @@ int qemuDomainDetachDiskDevice(struct qemud_driver *driver,
i = qemuFindDisk(vm->def, dev->data.disk->dst);
if (i < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("disk %s not found"), dev->data.disk->dst);
virReportError(VIR_ERR_OPERATION_FAILED,
_("disk %s not found"), dev->data.disk->dst);
goto cleanup;
}
if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("Underlying qemu does not support %s disk removal"),
virDomainDiskBusTypeToString(dev->data.disk->bus));
virReportError(VIR_ERR_OPERATION_FAILED,
_("Underlying qemu does not support %s disk removal"),
virDomainDiskBusTypeToString(dev->data.disk->bus));
goto cleanup;
}
@ -1766,9 +1766,9 @@ int qemuDomainDetachDiskDevice(struct qemud_driver *driver,
if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES)) {
if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find cgroup for %s"),
vm->def->name);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find cgroup for %s"),
vm->def->name);
goto cleanup;
}
}
@ -1887,30 +1887,30 @@ int qemuDomainDetachPciControllerDevice(struct qemud_driver *driver,
}
if (!detach) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("disk controller %s:%d not found"),
virDomainControllerTypeToString(dev->data.controller->type),
dev->data.controller->idx);
virReportError(VIR_ERR_OPERATION_FAILED,
_("disk controller %s:%d not found"),
virDomainControllerTypeToString(dev->data.controller->type),
dev->data.controller->idx);
goto cleanup;
}
if (!virDomainDeviceAddressIsValid(&detach->info,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("device cannot be detached without a PCI address"));
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("device cannot be detached without a PCI address"));
goto cleanup;
}
if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("cannot hot unplug multifunction PCI device: %s"),
dev->data.disk->dst);
virReportError(VIR_ERR_OPERATION_FAILED,
_("cannot hot unplug multifunction PCI device: %s"),
dev->data.disk->dst);
goto cleanup;
}
if (qemuDomainControllerIsBusy(vm, detach)) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("device cannot be detached: device is busy"));
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("device cannot be detached: device is busy"));
goto cleanup;
}
@ -1973,17 +1973,17 @@ qemuDomainDetachHostPciDevice(struct qemud_driver *driver,
pciDevice *activePci;
if (qemuIsMultiFunctionDevice(vm->def, detach->info)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("cannot hot unplug multifunction PCI device: %.4x:%.2x:%.2x.%.1x"),
subsys->u.pci.domain, subsys->u.pci.bus,
subsys->u.pci.slot, subsys->u.pci.function);
virReportError(VIR_ERR_OPERATION_FAILED,
_("cannot hot unplug multifunction PCI device: %.4x:%.2x:%.2x.%.1x"),
subsys->u.pci.domain, subsys->u.pci.bus,
subsys->u.pci.slot, subsys->u.pci.function);
return -1;
}
if (!virDomainDeviceAddressIsValid(detach->info,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("device cannot be detached without a PCI address"));
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("device cannot be detached without a PCI address"));
return -1;
}
@ -2042,14 +2042,14 @@ qemuDomainDetachHostUsbDevice(struct qemud_driver *driver,
int ret;
if (!detach->info->alias) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("device cannot be detached without a device alias"));
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("device cannot be detached without a device alias"));
return -1;
}
if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("device cannot be detached with this QEMU version"));
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("device cannot be detached with this QEMU version"));
return -1;
}
@ -2088,9 +2088,9 @@ int qemuDomainDetachThisHostDevice(struct qemud_driver *driver,
break;
}
if (idx >= vm->def->nhostdevs) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("device not found in hostdevs list (%d entries)"),
vm->def->nhostdevs);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("device not found in hostdevs list (%d entries)"),
vm->def->nhostdevs);
return ret;
}
}
@ -2103,9 +2103,9 @@ int qemuDomainDetachThisHostDevice(struct qemud_driver *driver,
ret = qemuDomainDetachHostUsbDevice(driver, vm, detach);
break;
default:
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("hostdev subsys type '%s' not supported"),
virDomainHostdevSubsysTypeToString(detach->source.subsys.type));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("hostdev subsys type '%s' not supported"),
virDomainHostdevSubsysTypeToString(detach->source.subsys.type));
return -1;
}
@ -2131,9 +2131,9 @@ int qemuDomainDetachHostDevice(struct qemud_driver *driver,
int idx;
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("hostdev mode '%s' not supported"),
virDomainHostdevModeTypeToString(hostdev->mode));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("hostdev mode '%s' not supported"),
virDomainHostdevModeTypeToString(hostdev->mode));
return -1;
}
@ -2142,25 +2142,25 @@ int qemuDomainDetachHostDevice(struct qemud_driver *driver,
if (idx < 0) {
switch(subsys->type) {
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("host pci device %.4x:%.2x:%.2x.%.1x not found"),
subsys->u.pci.domain, subsys->u.pci.bus,
subsys->u.pci.slot, subsys->u.pci.function);
virReportError(VIR_ERR_OPERATION_FAILED,
_("host pci device %.4x:%.2x:%.2x.%.1x not found"),
subsys->u.pci.domain, subsys->u.pci.bus,
subsys->u.pci.slot, subsys->u.pci.function);
break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
if (subsys->u.usb.bus && subsys->u.usb.device) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("host usb device %03d.%03d not found"),
subsys->u.usb.bus, subsys->u.usb.device);
virReportError(VIR_ERR_OPERATION_FAILED,
_("host usb device %03d.%03d not found"),
subsys->u.usb.bus, subsys->u.usb.device);
} else {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("host usb device vendor=0x%.4x product=0x%.4x not found"),
subsys->u.usb.vendor, subsys->u.usb.product);
virReportError(VIR_ERR_OPERATION_FAILED,
_("host usb device vendor=0x%.4x product=0x%.4x not found"),
subsys->u.usb.vendor, subsys->u.usb.product);
}
break;
default:
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected hostdev type %d"), subsys->type);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected hostdev type %d"), subsys->type);
break;
}
return -1;
@ -2197,11 +2197,11 @@ qemuDomainDetachNetDevice(struct qemud_driver *driver,
}
if (!detach) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("network device %02x:%02x:%02x:%02x:%02x:%02x not found"),
dev->data.net->mac.addr[0], dev->data.net->mac.addr[1],
dev->data.net->mac.addr[2], dev->data.net->mac.addr[3],
dev->data.net->mac.addr[4], dev->data.net->mac.addr[5]);
virReportError(VIR_ERR_OPERATION_FAILED,
_("network device %02x:%02x:%02x:%02x:%02x:%02x not found"),
dev->data.net->mac.addr[0], dev->data.net->mac.addr[1],
dev->data.net->mac.addr[2], dev->data.net->mac.addr[3],
dev->data.net->mac.addr[4], dev->data.net->mac.addr[5]);
goto cleanup;
}
@ -2214,21 +2214,21 @@ qemuDomainDetachNetDevice(struct qemud_driver *driver,
if (!virDomainDeviceAddressIsValid(&detach->info,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("device cannot be detached without a PCI address"));
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("device cannot be detached without a PCI address"));
goto cleanup;
}
if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("cannot hot unplug multifunction PCI device :%s"),
dev->data.disk->dst);
virReportError(VIR_ERR_OPERATION_FAILED,
_("cannot hot unplug multifunction PCI device :%s"),
dev->data.disk->dst);
goto cleanup;
}
if ((vlan = qemuDomainNetVLAN(detach)) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("unable to determine original VLAN"));
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("unable to determine original VLAN"));
goto cleanup;
}
@ -2341,8 +2341,8 @@ qemuDomainChangeGraphicsPasswords(struct qemud_driver *driver,
if (ret == -2) {
if (type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Graphics password only supported for VNC"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Graphics password only supported for VNC"));
ret = -1;
} else {
ret = qemuMonitorSetVNCPassword(priv->mon,
@ -2367,8 +2367,8 @@ qemuDomainChangeGraphicsPasswords(struct qemud_driver *driver,
if (ret == -2) {
/* XXX we could fake this with a timer */
if (auth->expires) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Expiry of passwords is not supported"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Expiry of passwords is not supported"));
ret = -1;
} else {
ret = 0;
@ -2405,9 +2405,9 @@ int qemuDomainDetachLease(struct qemud_driver *driver,
int i;
if ((i = virDomainLeaseIndex(vm->def, lease)) < 0) {
qemuReportError(VIR_ERR_INVALID_ARG,
_("Lease %s in lockspace %s does not exist"),
lease->key, NULLSTR(lease->lockspace));
virReportError(VIR_ERR_INVALID_ARG,
_("Lease %s in lockspace %s does not exist"),
lease->key, NULLSTR(lease->lockspace));
return -1;
}

View File

@ -164,16 +164,16 @@ qemuDomainExtractTLSSubject(const char *certdir)
goto no_memory;
if (virFileReadAll(certfile, 8192, &pemdata) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to read server cert %s"), certfile);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to read server cert %s"), certfile);
goto error;
}
ret = gnutls_x509_crt_init(&cert);
if (ret < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot initialize cert object: %s"),
gnutls_strerror(ret));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot initialize cert object: %s"),
gnutls_strerror(ret));
goto error;
}
@ -182,9 +182,9 @@ qemuDomainExtractTLSSubject(const char *certdir)
ret = gnutls_x509_crt_import(cert, &pemdatum, GNUTLS_X509_FMT_PEM);
if (ret < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot load cert data from %s: %s"),
certfile, gnutls_strerror(ret));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot load cert data from %s: %s"),
certfile, gnutls_strerror(ret));
goto error;
}
@ -277,8 +277,8 @@ qemuMigrationCookieNew(virDomainObjPtr dom)
if (!(mig->localHostname = virGetHostname(NULL)))
goto error;
if (virGetHostUUID(mig->localHostuuid) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to obtain host UUID"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to obtain host UUID"));
goto error;
}
@ -298,8 +298,8 @@ qemuMigrationCookieAddGraphics(qemuMigrationCookiePtr mig,
virDomainObjPtr dom)
{
if (mig->flags & QEMU_MIGRATION_COOKIE_GRAPHICS) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Migration graphics data already present"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Migration graphics data already present"));
return -1;
}
@ -324,8 +324,8 @@ qemuMigrationCookieAddLockstate(qemuMigrationCookiePtr mig,
qemuDomainObjPrivatePtr priv = dom->privateData;
if (mig->flags & QEMU_MIGRATION_COOKIE_LOCKSTATE) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Migration lockstate data already present"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Migration lockstate data already present"));
return -1;
}
@ -355,8 +355,8 @@ qemuMigrationCookieAddPersistent(qemuMigrationCookiePtr mig,
virDomainObjPtr dom)
{
if (mig->flags & QEMU_MIGRATION_COOKIE_PERSISTENT) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Migration persistent data already present"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Migration persistent data already present"));
return -1;
}
@ -474,32 +474,32 @@ qemuMigrationCookieGraphicsXMLParse(xmlXPathContextPtr ctxt)
goto no_memory;
if (!(tmp = virXPathString("string(./graphics/@type)", ctxt))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing type attribute in migration data"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing type attribute in migration data"));
goto error;
}
if ((grap->type = virDomainGraphicsTypeFromString(tmp)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown graphics type %s"), tmp);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown graphics type %s"), tmp);
VIR_FREE(tmp);
goto error;
}
VIR_FREE(tmp);
if (virXPathInt("string(./graphics/@port)", ctxt, &grap->port) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing port attribute in migration data"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing port attribute in migration data"));
goto error;
}
if (grap->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
if (virXPathInt("string(./graphics/@tlsPort)", ctxt, &grap->tlsPort) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing tlsPort attribute in migration data"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing tlsPort attribute in migration data"));
goto error;
}
}
if (!(grap->listen = virXPathString("string(./graphics/@listen)", ctxt))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing listen attribute in migration data"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing listen attribute in migration data"));
goto error;
}
/* Optional */
@ -535,14 +535,14 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
/* Extract domain name */
if (!(tmp = virXPathString("string(./name[1])", ctxt))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing name element in migration data"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing name element in migration data"));
goto error;
}
if (STRNEQ(tmp, mig->name)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Incoming cookie data had unexpected name %s vs %s"),
tmp, mig->name);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Incoming cookie data had unexpected name %s vs %s"),
tmp, mig->name);
goto error;
}
VIR_FREE(tmp);
@ -550,45 +550,45 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
/* Extract domain uuid */
tmp = virXPathString("string(./uuid[1])", ctxt);
if (!tmp) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing uuid element in migration data"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing uuid element in migration data"));
goto error;
}
virUUIDFormat(mig->uuid, uuidstr);
if (STRNEQ(tmp, uuidstr)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Incoming cookie data had unexpected UUID %s vs %s"),
tmp, uuidstr);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Incoming cookie data had unexpected UUID %s vs %s"),
tmp, uuidstr);
}
VIR_FREE(tmp);
/* Check & forbid "localhost" migration */
if (!(mig->remoteHostname = virXPathString("string(./hostname[1])", ctxt))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing hostname element in migration data"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing hostname element in migration data"));
goto error;
}
if (STREQ(mig->remoteHostname, mig->localHostname)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Attempt to migrate guest to the same host %s"),
mig->remoteHostname);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Attempt to migrate guest to the same host %s"),
mig->remoteHostname);
goto error;
}
if (!(tmp = virXPathString("string(./hostuuid[1])", ctxt))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing hostuuid element in migration data"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing hostuuid element in migration data"));
goto error;
}
if (virUUIDParse(tmp, mig->remoteHostuuid) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("malformed hostuuid element in migration data"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("malformed hostuuid element in migration data"));
goto error;
}
if (memcmp(mig->remoteHostuuid, mig->localHostuuid, VIR_UUID_BUFLEN) == 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Attempt to migrate guest to the same host %s"),
tmp);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Attempt to migrate guest to the same host %s"),
tmp);
goto error;
}
VIR_FREE(tmp);
@ -602,23 +602,23 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
int val;
char *str = virXMLPropString(nodes[i], "name");
if (!str) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing feature name"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing feature name"));
goto error;
}
if ((val = qemuMigrationCookieFlagTypeFromString(str)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown migration cookie feature %s"),
str);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown migration cookie feature %s"),
str);
VIR_FREE(str);
goto error;
}
if ((flags & (1 << val)) == 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unsupported migration cookie feature %s"),
str);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unsupported migration cookie feature %s"),
str);
VIR_FREE(str);
}
VIR_FREE(str);
@ -634,8 +634,8 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
virXPathBoolean("count(./lockstate) > 0", ctxt)) {
mig->lockDriver = virXPathString("string(./lockstate[1]/@driver)", ctxt);
if (!mig->lockDriver) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing lock driver name in migration cookie"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing lock driver name in migration cookie"));
goto error;
}
mig->lockState = virXPathString("string(./lockstate[1]/leases[1])", ctxt);
@ -646,10 +646,10 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
if ((flags & QEMU_MIGRATION_COOKIE_PERSISTENT) &&
virXPathBoolean("count(./domain) > 0", ctxt)) {
if ((n = virXPathNodeSet("./domain", ctxt, &nodes)) > 1) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Too many domain elements in "
"migration cookie: %d"),
n);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Too many domain elements in "
"migration cookie: %d"),
n);
goto error;
}
mig->persistent = virDomainDefParseNode(driver->caps, doc, nodes[0],
@ -744,8 +744,8 @@ qemuMigrationEatCookie(struct qemud_driver *driver,
/* Parse & validate incoming cookie (if any) */
if (cookiein && cookieinlen &&
cookiein[cookieinlen-1] != '\0') {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Migration cookie was not NULL terminated"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Migration cookie was not NULL terminated"));
goto error;
}
@ -764,17 +764,17 @@ qemuMigrationEatCookie(struct qemud_driver *driver,
if (mig->flags & QEMU_MIGRATION_COOKIE_LOCKSTATE) {
if (!mig->lockDriver) {
if (virLockManagerPluginUsesState(driver->lockManager)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Missing %s lock state for migration cookie"),
virLockManagerPluginGetName(driver->lockManager));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Missing %s lock state for migration cookie"),
virLockManagerPluginGetName(driver->lockManager));
goto error;
}
} else if (STRNEQ(mig->lockDriver,
virLockManagerPluginGetName(driver->lockManager))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Source host lock driver %s different from target %s"),
mig->lockDriver,
virLockManagerPluginGetName(driver->lockManager));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Source host lock driver %s different from target %s"),
mig->lockDriver,
virLockManagerPluginGetName(driver->lockManager));
goto error;
}
}
@ -803,23 +803,23 @@ qemuMigrationIsAllowed(struct qemud_driver *driver, virDomainObjPtr vm,
if (vm) {
if (qemuProcessAutoDestroyActive(driver, vm)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is marked for auto destroy"));
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is marked for auto destroy"));
return false;
}
if ((nsnapshots = virDomainSnapshotObjListNum(&vm->snapshots, NULL,
0))) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
_("cannot migrate domain with %d snapshots"),
nsnapshots);
virReportError(VIR_ERR_OPERATION_INVALID,
_("cannot migrate domain with %d snapshots"),
nsnapshots);
return false;
}
def = vm->def;
}
if (def->nhostdevs > 0) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("Domain with assigned host devices cannot be migrated"));
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("Domain with assigned host devices cannot be migrated"));
return false;
}
@ -852,9 +852,9 @@ qemuMigrationIsSafe(virDomainDefPtr def)
continue;
}
qemuReportError(VIR_ERR_MIGRATE_UNSAFE, "%s",
_("Migration may lead to data corruption if disks"
" use cache != none"));
virReportError(VIR_ERR_MIGRATE_UNSAFE, "%s",
_("Migration may lead to data corruption if disks"
" use cache != none"));
return false;
}
}
@ -922,8 +922,8 @@ qemuMigrationUpdateJobStatus(struct qemud_driver *driver,
switch (status) {
case QEMU_MONITOR_MIGRATION_STATUS_INACTIVE:
priv->job.info.type = VIR_DOMAIN_JOB_NONE;
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("%s: %s"), job, _("is not active"));
virReportError(VIR_ERR_OPERATION_FAILED,
_("%s: %s"), job, _("is not active"));
break;
case QEMU_MONITOR_MIGRATION_STATUS_ACTIVE:
@ -945,14 +945,14 @@ qemuMigrationUpdateJobStatus(struct qemud_driver *driver,
case QEMU_MONITOR_MIGRATION_STATUS_ERROR:
priv->job.info.type = VIR_DOMAIN_JOB_FAILED;
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("%s: %s"), job, _("unexpectedly failed"));
virReportError(VIR_ERR_OPERATION_FAILED,
_("%s: %s"), job, _("unexpectedly failed"));
break;
case QEMU_MONITOR_MIGRATION_STATUS_CANCELLED:
priv->job.info.type = VIR_DOMAIN_JOB_CANCELLED;
qemuReportError(VIR_ERR_OPERATION_ABORTED,
_("%s: %s"), job, _("canceled by client"));
virReportError(VIR_ERR_OPERATION_ABORTED,
_("%s: %s"), job, _("canceled by client"));
break;
}
@ -992,8 +992,8 @@ qemuMigrationWaitForCompletion(struct qemud_driver *driver, virDomainObjPtr vm,
goto cleanup;
if (dconn && virConnectIsAlive(dconn) <= 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Lost connection to destination host"));
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Lost connection to destination host"));
goto cleanup;
}
@ -1158,8 +1158,8 @@ char *qemuMigrationBegin(struct qemud_driver *driver,
goto cleanup;
if (STRNEQ(def->name, vm->def->name)) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("target domain name doesn't match source name"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("target domain name doesn't match source name"));
goto cleanup;
}
@ -1371,8 +1371,8 @@ qemuMigrationPrepareAny(struct qemud_driver *driver,
*/
if (qemuMigrationJobContinue(vm) == 0) {
vm = NULL;
qemuReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("domain disappeared"));
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("domain disappeared"));
goto cleanup;
}
@ -1480,9 +1480,9 @@ qemuMigrationPrepareDirect(struct qemud_driver *driver,
goto cleanup;
if (STRPREFIX(hostname, "localhost")) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("hostname on destination resolved to localhost,"
" but migration requires an FQDN"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("hostname on destination resolved to localhost,"
" but migration requires an FQDN"));
goto cleanup;
}
@ -1502,9 +1502,9 @@ qemuMigrationPrepareDirect(struct qemud_driver *driver,
* characters in hostname part don't matter.
*/
if (!STRPREFIX (uri_in, "tcp:")) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("only tcp URIs are supported for KVM/QEMU"
" migrations"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("only tcp URIs are supported for KVM/QEMU"
" migrations"));
goto cleanup;
}
@ -1526,8 +1526,8 @@ qemuMigrationPrepareDirect(struct qemud_driver *driver,
p++; /* definitely has a ':' in it, see above */
this_port = virParseNumber (&p);
if (this_port == -1 || p-uri_in != strlen (uri_in)) {
qemuReportError(VIR_ERR_INVALID_ARG,
"%s", _("URI ended with incorrect ':port'"));
virReportError(VIR_ERR_INVALID_ARG,
"%s", _("URI ended with incorrect ':port'"));
goto cleanup;
}
}
@ -1850,10 +1850,10 @@ qemuMigrationRun(struct qemud_driver *driver,
if (virLockManagerPluginUsesState(driver->lockManager) &&
!cookieout) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Migration with lock driver %s requires"
" cookie support"),
virLockManagerPluginGetName(driver->lockManager));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Migration with lock driver %s requires"
" cookie support"),
virLockManagerPluginGetName(driver->lockManager));
return -1;
}
@ -1932,8 +1932,8 @@ qemuMigrationRun(struct qemud_driver *driver,
ret = -1;
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
goto cleanup;
}
@ -2102,8 +2102,8 @@ static int doTunnelMigrate(struct qemud_driver *driver,
if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_FD) &&
!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_UNIX) &&
!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_EXEC)) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Source qemu is too old to support tunnelled migration"));
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Source qemu is too old to support tunnelled migration"));
return -1;
}
@ -2233,15 +2233,15 @@ static int doPeer2PeerMigrate2(struct qemud_driver *driver,
* in qemuDomainObjEnterRemoteWithDriver, so check again
*/
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
goto cleanup;
}
if (!(flags & VIR_MIGRATE_TUNNELLED) &&
(uri_out == NULL)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("domainMigratePrepare2 did not set uri"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("domainMigratePrepare2 did not set uri"));
cancelled = 1;
goto finish;
}
@ -2378,8 +2378,8 @@ static int doPeer2PeerMigrate3(struct qemud_driver *driver,
if (!(flags & VIR_MIGRATE_TUNNELLED) &&
(uri_out == NULL)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("domainMigratePrepare3 did not set uri"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("domainMigratePrepare3 did not set uri"));
cancelled = 1;
goto finish;
}
@ -2529,8 +2529,8 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver,
dconn = virConnectOpen(dconnuri);
qemuDomainObjExitRemoteWithDriver(driver, vm);
if (dconn == NULL) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("Failed to connect to remote libvirt URI %s"), dconnuri);
virReportError(VIR_ERR_OPERATION_FAILED,
_("Failed to connect to remote libvirt URI %s"), dconnuri);
return -1;
}
@ -2550,15 +2550,15 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver,
qemuDomainObjExitRemoteWithDriver(driver, vm);
if (!p2p) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Destination libvirt does not support peer-to-peer migration protocol"));
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Destination libvirt does not support peer-to-peer migration protocol"));
goto cleanup;
}
/* domain may have been stopped while we were talking to remote daemon */
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
goto cleanup;
}
@ -2620,8 +2620,8 @@ qemuMigrationPerformJob(struct qemud_driver *driver,
goto cleanup;
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto endjob;
}
@ -2816,8 +2816,8 @@ qemuMigrationPerform(struct qemud_driver *driver,
if ((flags & (VIR_MIGRATE_TUNNELLED | VIR_MIGRATE_PEER2PEER))) {
if (cookieinlen) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("received unexpected cookie with P2P migration"));
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("received unexpected cookie with P2P migration"));
return -1;
}
@ -2827,8 +2827,8 @@ qemuMigrationPerform(struct qemud_driver *driver,
v3proto);
} else {
if (dconnuri) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unexpected dconnuri parameter with non-peer2peer migration"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unexpected dconnuri parameter with non-peer2peer migration"));
return -1;
}
@ -2863,9 +2863,9 @@ qemuMigrationVPAssociatePortProfiles(virDomainDefPtr def) {
def->uuid,
VIR_NETDEV_VPORT_PROFILE_OP_MIGRATE_IN_FINISH,
false) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("Port profile Associate failed for %s"),
net->ifname);
virReportError(VIR_ERR_OPERATION_FAILED,
_("Port profile Associate failed for %s"),
net->ifname);
goto err_exit;
}
VIR_DEBUG("Port profile Associate succeeded for %s", net->ifname);
@ -2943,8 +2943,8 @@ qemuMigrationFinish(struct qemud_driver *driver,
*/
if (retcode == 0) {
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
goto endjob;
}
@ -2990,8 +2990,8 @@ qemuMigrationFinish(struct qemud_driver *driver,
vm->persistent = 0;
}
if (!vmdef)
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("can't get vmdef"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("can't get vmdef"));
goto endjob;
}
@ -3014,8 +3014,8 @@ qemuMigrationFinish(struct qemud_driver *driver,
VIR_DOMAIN_RUNNING_MIGRATED,
QEMU_ASYNC_JOB_MIGRATION_IN) < 0) {
if (virGetLastError() == NULL)
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("resume operation failed"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("resume operation failed"));
/* Need to save the current error, in case shutting
* down the process overwrites it
*/
@ -3144,8 +3144,8 @@ int qemuMigrationConfirm(struct qemud_driver *driver,
VIR_DOMAIN_RUNNING_MIGRATED,
QEMU_ASYNC_JOB_MIGRATION_OUT) < 0) {
if (virGetLastError() == NULL)
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("resume operation failed"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("resume operation failed"));
goto cleanup;
}
@ -3214,9 +3214,9 @@ qemuMigrationToFile(struct qemud_driver *driver, virDomainObjPtr vm,
VIR_CGROUP_CONTROLLER_DEVICES)) {
if (virCgroupForDomain(driver->cgroup, vm->def->name,
&cgroup, 0) != 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find cgroup for %s"),
vm->def->name);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find cgroup for %s"),
vm->def->name);
goto cleanup;
}
rc = virCgroupAllowDevicePath(cgroup, path,
@ -3401,7 +3401,7 @@ qemuMigrationJobIsActive(virDomainObjPtr vm,
else
msg = _("domain '%s' is not being migrated");
qemuReportError(VIR_ERR_OPERATION_INVALID, msg, vm->def->name);
virReportError(VIR_ERR_OPERATION_INVALID, msg, vm->def->name);
return false;
}
return true;

View File

@ -286,8 +286,8 @@ qemuMonitorOpenUnix(const char *monitor, pid_t cpid)
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
if (virStrcpyStatic(addr.sun_path, monitor) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Monitor path %s too big for destination"), monitor);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Monitor path %s too big for destination"), monitor);
goto error;
}
@ -329,8 +329,8 @@ qemuMonitorOpenPty(const char *monitor)
int monfd;
if ((monfd = open(monitor, O_RDWR)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to open monitor path %s"), monitor);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to open monitor path %s"), monitor);
return -1;
}
@ -451,8 +451,8 @@ qemuMonitorIOWrite(qemuMonitorPtr mon)
return 0;
if (mon->msg->txFD != -1 && !mon->hasSendFD) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Monitor does not support sending of file descriptors"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Monitor does not support sending of file descriptors"));
return -1;
}
@ -577,9 +577,9 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) {
if (mon->fd != fd || mon->watch != watch) {
if (events & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR))
eof = true;
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("event from unexpected fd %d!=%d / watch %d!=%d"),
mon->fd, fd, mon->watch, watch);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("event from unexpected fd %d!=%d / watch %d!=%d"),
mon->fd, fd, mon->watch, watch);
error = true;
} else if (mon->lastError.code != VIR_ERR_OK) {
if (events & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR))
@ -612,23 +612,23 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) {
if (!error &&
events & VIR_EVENT_HANDLE_HANGUP) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("End of file from monitor"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("End of file from monitor"));
eof = 1;
events &= ~VIR_EVENT_HANDLE_HANGUP;
}
if (!error && !eof &&
events & VIR_EVENT_HANDLE_ERROR) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Invalid file descriptor while waiting for monitor"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Invalid file descriptor while waiting for monitor"));
eof = 1;
events &= ~VIR_EVENT_HANDLE_ERROR;
}
if (!error && events) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Unhandled event %d for monitor fd %d"),
events, mon->fd);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unhandled event %d for monitor fd %d"),
events, mon->fd);
error = 1;
}
}
@ -640,8 +640,8 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) {
} else {
virErrorPtr err = virGetLastError();
if (!err)
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Error while processing monitor IO"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Error while processing monitor IO"));
virCopyLastError(&mon->lastError);
virResetLastError();
}
@ -698,8 +698,8 @@ qemuMonitorOpen(virDomainObjPtr vm,
qemuMonitorPtr mon;
if (!cb || !cb->eofNotify) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("EOF notify callback must be supplied"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("EOF notify callback must be supplied"));
return NULL;
}
@ -709,14 +709,14 @@ qemuMonitorOpen(virDomainObjPtr vm,
}
if (virMutexInit(&mon->lock) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot initialize monitor mutex"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot initialize monitor mutex"));
VIR_FREE(mon);
return NULL;
}
if (virCondInit(&mon->notify) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot initialize monitor condition"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot initialize monitor condition"));
virMutexDestroy(&mon->lock);
VIR_FREE(mon);
return NULL;
@ -739,22 +739,22 @@ qemuMonitorOpen(virDomainObjPtr vm,
break;
default:
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to handle monitor type: %s"),
virDomainChrTypeToString(config->type));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to handle monitor type: %s"),
virDomainChrTypeToString(config->type));
goto cleanup;
}
if (mon->fd == -1) goto cleanup;
if (virSetCloseExec(mon->fd) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to set monitor close-on-exec flag"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to set monitor close-on-exec flag"));
goto cleanup;
}
if (virSetNonBlock(mon->fd) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to put monitor into non-blocking mode"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to put monitor into non-blocking mode"));
goto cleanup;
}
@ -765,8 +765,8 @@ qemuMonitorOpen(virDomainObjPtr vm,
VIR_EVENT_HANDLE_READABLE,
qemuMonitorIO,
mon, qemuMonitorUnwatch)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("unable to register monitor events"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("unable to register monitor events"));
goto cleanup;
}
qemuMonitorRef(mon);
@ -813,8 +813,8 @@ void qemuMonitorClose(qemuMonitorPtr mon)
if (mon->lastError.code == VIR_ERR_OK) {
virErrorPtr err = virSaveLastError();
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Qemu monitor was closed"));
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Qemu monitor was closed"));
virCopyLastError(&mon->lastError);
if (err) {
virSetError(err);
@ -866,8 +866,8 @@ int qemuMonitorSend(qemuMonitorPtr mon,
while (!mon->msg->finished) {
if (virCondWait(&mon->notify, &mon->lock) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to wait on monitor condition"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to wait on monitor condition"));
goto cleanup;
}
}
@ -902,8 +902,8 @@ int qemuMonitorHMPCommandWithFd(qemuMonitorPtr mon,
json_cmd = qemuMonitorUnescapeArg(cmd);
if (!json_cmd) {
VIR_DEBUG("Could not unescape command: %s", cmd);
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to unescape command"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to unescape command"));
goto cleanup;
}
ret = qemuMonitorJSONHumanCommandWithFd(mon, json_cmd, scm_fd, reply);
@ -1105,8 +1105,8 @@ int qemuMonitorSetCapabilities(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1155,8 +1155,8 @@ qemuMonitorStartCPUs(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1175,8 +1175,8 @@ qemuMonitorStopCPUs(qemuMonitorPtr mon)
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1197,8 +1197,8 @@ qemuMonitorGetStatus(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p, running=%p, reason=%p", mon, running, reason);
if (!mon || !running) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("both monitor and running must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("both monitor and running must not be NULL"));
return -1;
}
@ -1216,8 +1216,8 @@ int qemuMonitorSystemPowerdown(qemuMonitorPtr mon)
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1235,8 +1235,8 @@ int qemuMonitorSystemReset(qemuMonitorPtr mon)
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1255,8 +1255,8 @@ int qemuMonitorGetCPUInfo(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1275,8 +1275,8 @@ int qemuMonitorSetLink(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p, name=%p:%s, state=%u", mon, name, name, state);
if (!mon || !name) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor || name must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor || name must not be NULL"));
return -1;
}
@ -1294,8 +1294,8 @@ int qemuMonitorGetVirtType(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1314,8 +1314,8 @@ int qemuMonitorGetBalloonInfo(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1335,8 +1335,8 @@ int qemuMonitorGetMemoryStats(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p stats=%p nstats=%u", mon, stats, nr_stats);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1353,8 +1353,8 @@ qemuMonitorBlockIOStatusToError(const char *status)
int st = qemuMonitorBlockIOStatusTypeFromString(status);
if (st < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown block IO status: %s"), status);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown block IO status: %s"), status);
return -1;
}
@ -1382,8 +1382,8 @@ qemuMonitorGetBlockInfo(qemuMonitorPtr mon)
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return NULL;
}
@ -1412,9 +1412,9 @@ qemuMonitorBlockInfoLookup(virHashTablePtr blockInfo,
VIR_DEBUG("blockInfo=%p dev=%s", blockInfo, NULLSTR(devname));
if (!(info = virHashLookup(blockInfo, devname))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find info for device '%s'"),
NULLSTR(devname));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find info for device '%s'"),
NULLSTR(devname));
}
return info;
@ -1436,8 +1436,8 @@ int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p dev=%s", mon, dev_name);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1472,8 +1472,8 @@ int qemuMonitorGetBlockStatsParamsNumber(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p nparams=%p", mon, nparams);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1525,8 +1525,8 @@ int qemuMonitorSetVNCPassword(qemuMonitorPtr mon,
mon, password);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1548,9 +1548,9 @@ static const char* qemuMonitorTypeToProtocol(int type)
case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
return "spice";
default:
qemuReportError(VIR_ERR_INVALID_ARG,
_("unsupported protocol type %s"),
virDomainGraphicsTypeToString(type));
virReportError(VIR_ERR_INVALID_ARG,
_("unsupported protocol type %s"),
virDomainGraphicsTypeToString(type));
return NULL;
}
}
@ -1571,8 +1571,8 @@ int qemuMonitorSetPassword(qemuMonitorPtr mon,
mon, protocol, password, action_if_connected);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1603,8 +1603,8 @@ int qemuMonitorExpirePassword(qemuMonitorPtr mon,
mon, protocol, expire_time);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1625,8 +1625,8 @@ int qemuMonitorSetBalloon(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p newmem=%lu", mon, newmem);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1644,8 +1644,8 @@ int qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, int online)
VIR_DEBUG("mon=%p cpu=%d online=%d", mon, cpu, online);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1665,8 +1665,8 @@ int qemuMonitorEjectMedia(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p dev_name=%s force=%d", mon, dev_name, force);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1688,8 +1688,8 @@ int qemuMonitorChangeMedia(qemuMonitorPtr mon,
mon, dev_name, newmedia, format);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1711,8 +1711,8 @@ int qemuMonitorSaveVirtualMemory(qemuMonitorPtr mon,
mon, offset, length, path);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1733,8 +1733,8 @@ int qemuMonitorSavePhysicalMemory(qemuMonitorPtr mon,
mon, offset, length, path);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1753,8 +1753,8 @@ int qemuMonitorSetMigrationSpeed(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p bandwidth=%lu", mon, bandwidth);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1773,8 +1773,8 @@ int qemuMonitorSetMigrationDowntime(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p downtime=%llu", mon, downtime);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1796,8 +1796,8 @@ int qemuMonitorGetMigrationStatus(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1824,8 +1824,8 @@ int qemuMonitorMigrateToFd(qemuMonitorPtr mon,
mon, fd, flags);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1857,8 +1857,8 @@ int qemuMonitorMigrateToHost(qemuMonitorPtr mon,
mon, hostname, port, flags);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1889,8 +1889,8 @@ int qemuMonitorMigrateToCommand(qemuMonitorPtr mon,
mon, argv, flags);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1931,15 +1931,15 @@ int qemuMonitorMigrateToFile(qemuMonitorPtr mon,
mon, argv, target, offset, flags);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
if (offset % QEMU_MONITOR_MIGRATE_TO_FILE_BS) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("file offset must be a multiple of %llu"),
QEMU_MONITOR_MIGRATE_TO_FILE_BS);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("file offset must be a multiple of %llu"),
QEMU_MONITOR_MIGRATE_TO_FILE_BS);
return -1;
}
@ -1996,8 +1996,8 @@ int qemuMonitorMigrateToUnix(qemuMonitorPtr mon,
mon, unixfile, flags);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2021,8 +2021,8 @@ int qemuMonitorMigrateCancel(qemuMonitorPtr mon)
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2044,8 +2044,8 @@ int qemuMonitorDumpToFd(qemuMonitorPtr mon,
mon, fd, flags, begin, length);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2053,8 +2053,8 @@ int qemuMonitorDumpToFd(qemuMonitorPtr mon,
/* We don't have qemuMonitorTextDump(), so we should check mon->json
* here.
*/
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
_("dump-guest-memory is not supported in text mode"));
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("dump-guest-memory is not supported in text mode"));
return -1;
}
@ -2108,8 +2108,8 @@ int qemuMonitorAddUSBDisk(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p path=%s", mon, path);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2129,8 +2129,8 @@ int qemuMonitorAddUSBDeviceExact(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p bus=%d dev=%d", mon, bus, dev);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2150,8 +2150,8 @@ int qemuMonitorAddUSBDeviceMatch(qemuMonitorPtr mon,
mon, vendor, product);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2173,8 +2173,8 @@ int qemuMonitorAddPCIHostDevice(qemuMonitorPtr mon,
hostAddr->domain, hostAddr->bus, hostAddr->slot, hostAddr->function);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2196,8 +2196,8 @@ int qemuMonitorAddPCIDisk(qemuMonitorPtr mon,
mon, path, bus);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2217,8 +2217,8 @@ int qemuMonitorAddPCINetwork(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p nicstr=%s", mon, nicstr);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2239,8 +2239,8 @@ int qemuMonitorRemovePCIDevice(qemuMonitorPtr mon,
guestAddr->slot, guestAddr->function);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2261,21 +2261,21 @@ int qemuMonitorSendFileHandle(qemuMonitorPtr mon,
mon, fdname, fd);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
if (fd < 0) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("fd must be valid"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("fd must be valid"));
return -1;
}
if (!mon->hasSendFD) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("qemu is not using a unix socket monitor, "
"cannot send fd %s"), fdname);
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("qemu is not using a unix socket monitor, "
"cannot send fd %s"), fdname);
return -1;
}
@ -2299,8 +2299,8 @@ int qemuMonitorCloseFileHandle(qemuMonitorPtr mon,
error = virSaveLastError();
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
goto cleanup;
}
@ -2330,8 +2330,8 @@ int qemuMonitorAddHostNetwork(qemuMonitorPtr mon,
vhostfd, NULLSTR(vhostfd_name));
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2369,8 +2369,8 @@ int qemuMonitorRemoveHostNetwork(qemuMonitorPtr mon,
mon, netname);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2394,8 +2394,8 @@ int qemuMonitorAddNetdev(qemuMonitorPtr mon,
vhostfd, NULLSTR(vhostfd_name));
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2431,8 +2431,8 @@ int qemuMonitorRemoveNetdev(qemuMonitorPtr mon,
mon, alias);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2452,8 +2452,8 @@ int qemuMonitorGetPtyPaths(qemuMonitorPtr mon,
mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2473,8 +2473,8 @@ int qemuMonitorAttachPCIDiskController(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2499,8 +2499,8 @@ int qemuMonitorAttachDrive(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2519,8 +2519,8 @@ int qemuMonitorGetAllPCIAddresses(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2538,8 +2538,8 @@ int qemuMonitorDriveDel(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2557,8 +2557,8 @@ int qemuMonitorDelDevice(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2580,8 +2580,8 @@ int qemuMonitorAddDeviceWithFd(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2614,8 +2614,8 @@ int qemuMonitorAddDrive(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2635,8 +2635,8 @@ int qemuMonitorSetDrivePassphrase(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2654,8 +2654,8 @@ int qemuMonitorCreateSnapshot(qemuMonitorPtr mon, const char *name)
VIR_DEBUG("mon=%p, name=%s",mon,name);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2673,8 +2673,8 @@ int qemuMonitorLoadSnapshot(qemuMonitorPtr mon, const char *name)
VIR_DEBUG("mon=%p, name=%s",mon,name);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2692,8 +2692,8 @@ int qemuMonitorDeleteSnapshot(qemuMonitorPtr mon, const char *name)
VIR_DEBUG("mon=%p, name=%s",mon,name);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2718,8 +2718,8 @@ qemuMonitorDiskSnapshot(qemuMonitorPtr mon, virJSONValuePtr actions,
mon, actions, device, file, format, reuse);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2728,8 +2728,8 @@ qemuMonitorDiskSnapshot(qemuMonitorPtr mon, virJSONValuePtr actions,
reuse);
} else {
if (actions || STRNEQ(format, "qcow2") || reuse) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("text monitor lacks several snapshot features"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("text monitor lacks several snapshot features"));
return -1;
}
ret = qemuMonitorTextDiskSnapshot(mon, device, file);
@ -2748,8 +2748,8 @@ qemuMonitorTransaction(qemuMonitorPtr mon, virJSONValuePtr actions)
if (mon->json)
ret = qemuMonitorJSONTransaction(mon, actions);
else
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("transaction requires JSON monitor"));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("transaction requires JSON monitor"));
return ret;
}
@ -2808,8 +2808,8 @@ int qemuMonitorScreendump(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p, file=%s", mon, file);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG,"%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG,"%s",
_("monitor must not be NULL"));
return -1;
}
@ -2839,9 +2839,9 @@ int qemuMonitorBlockJob(qemuMonitorPtr mon,
/* Convert bandwidth MiB to bytes */
speed = bandwidth;
if (speed > ULLONG_MAX / 1024 / 1024) {
qemuReportError(VIR_ERR_OVERFLOW,
_("bandwidth must be less than %llu"),
ULLONG_MAX / 1024 / 1024);
virReportError(VIR_ERR_OVERFLOW,
_("bandwidth must be less than %llu"),
ULLONG_MAX / 1024 / 1024);
return -1;
}
speed <<= 20;
@ -2850,8 +2850,8 @@ int qemuMonitorBlockJob(qemuMonitorPtr mon,
ret = qemuMonitorJSONBlockJob(mon, device, base, speed, info, mode,
modern);
else
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("block jobs require JSON monitor"));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("block jobs require JSON monitor"));
return ret;
}
@ -2950,8 +2950,8 @@ int qemuMonitorOpenGraphics(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2976,14 +2976,14 @@ int qemuMonitorSystemWakeup(qemuMonitorPtr mon)
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
if (!mon->json) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("JSON monitor is required"));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("JSON monitor is required"));
return -1;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -368,9 +368,9 @@ qemuProcessFindDomainDiskByPath(virDomainObjPtr vm,
if (i >= 0)
return vm->def->disks[i];
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("no disk found with path %s"),
path);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("no disk found with path %s"),
path);
return NULL;
}
@ -391,9 +391,9 @@ qemuProcessFindDomainDiskByAlias(virDomainObjPtr vm,
return disk;
}
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("no disk found with alias %s"),
alias);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("no disk found with alias %s"),
alias);
return NULL;
}
@ -411,24 +411,24 @@ qemuProcessGetVolumeQcowPassphrase(virConnectPtr conn,
virStorageEncryptionPtr enc;
if (!disk->encryption) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("disk %s does not have any encryption information"),
disk->src);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("disk %s does not have any encryption information"),
disk->src);
return -1;
}
enc = disk->encryption;
if (!conn) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("cannot find secrets without a connection"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("cannot find secrets without a connection"));
goto cleanup;
}
if (conn->secretDriver == NULL ||
conn->secretDriver->lookupByUUID == NULL ||
conn->secretDriver->getValue == NULL) {
qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("secret storage not supported"));
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("secret storage not supported"));
goto cleanup;
}
@ -436,8 +436,8 @@ qemuProcessGetVolumeQcowPassphrase(virConnectPtr conn,
enc->nsecrets != 1 ||
enc->secrets[0]->type !=
VIR_STORAGE_ENCRYPTION_SECRET_TYPE_PASSPHRASE) {
qemuReportError(VIR_ERR_XML_ERROR,
_("invalid <encryption> for volume %s"), disk->src);
virReportError(VIR_ERR_XML_ERROR,
_("invalid <encryption> for volume %s"), disk->src);
goto cleanup;
}
@ -454,9 +454,9 @@ qemuProcessGetVolumeQcowPassphrase(virConnectPtr conn,
if (memchr(data, '\0', size) != NULL) {
memset(data, 0, size);
VIR_FREE(data);
qemuReportError(VIR_ERR_XML_ERROR,
_("format='qcow' passphrase for %s must not contain a "
"'\\0'"), disk->src);
virReportError(VIR_ERR_XML_ERROR,
_("format='qcow' passphrase for %s must not contain a "
"'\\0'"), disk->src);
goto cleanup;
}
@ -550,8 +550,8 @@ qemuProcessFakeReboot(void *opaque)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
goto endjob;
}
@ -563,8 +563,8 @@ qemuProcessFakeReboot(void *opaque)
qemuDomainObjExitMonitorWithDriver(driver, vm);
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
goto endjob;
}
@ -572,8 +572,8 @@ qemuProcessFakeReboot(void *opaque)
VIR_DOMAIN_RUNNING_BOOTED,
QEMU_ASYNC_JOB_NONE) < 0) {
if (virGetLastError() == NULL)
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("resume operation failed"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("resume operation failed"));
goto endjob;
}
priv->gotShutdown = false;
@ -1326,16 +1326,16 @@ qemuProcessReadLogOutput(virDomainObjPtr vm,
}
if (got == buflen-1) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Out of space while reading %s log output: %s"),
what, buf);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Out of space while reading %s log output: %s"),
what, buf);
goto cleanup;
}
if (isdead) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Process exited while reading %s log output: %s"),
what, buf);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Process exited while reading %s log output: %s"),
what, buf);
goto cleanup;
}
@ -1348,9 +1348,9 @@ qemuProcessReadLogOutput(virDomainObjPtr vm,
retries--;
}
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Timed out while reading %s log output: %s"),
what, buf);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Timed out while reading %s log output: %s"),
what, buf);
cleanup:
VIR_FREE(debug);
@ -1435,8 +1435,8 @@ qemuProcessLookupPTYs(virDomainChrDefPtr *devices,
/* neither the log output nor 'info chardev' had a
* pty path for this chardev, report an error
*/
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("no assigned pty for device %s"), id);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("no assigned pty for device %s"), id);
return -1;
} else {
/* 'info chardev' had no pty path for this chardev,
@ -1627,9 +1627,9 @@ cleanup:
/* VM is dead, any other error raised in the interim is probably
* not as important as the qemu cmdline output */
qemuProcessReadLogFD(logfd, buf, buf_size, strlen(buf));
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("process exited while connecting to monitor: %s"),
buf);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("process exited while connecting to monitor: %s"),
buf);
ret = -1;
}
@ -1672,10 +1672,10 @@ qemuProcessDetectVcpuPIDs(struct qemud_driver *driver,
qemuDomainObjExitMonitorWithDriver(driver, vm);
if (ncpupids != vm->def->vcpus) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("got wrong number of vCPU pids from QEMU monitor. "
"got %d, wanted %d"),
ncpupids, vm->def->vcpus);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("got wrong number of vCPU pids from QEMU monitor. "
"got %d, wanted %d"),
ncpupids, vm->def->vcpus);
VIR_FREE(cpupids);
return -1;
}
@ -1720,8 +1720,8 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm,
}
if (numa_available() < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Host kernel is not aware of NUMA."));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Host kernel is not aware of NUMA."));
return -1;
}
@ -1731,8 +1731,8 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm,
for (i = 0; i < VIR_DOMAIN_CPUMASK_LEN; i++) {
if (tmp_nodemask[i]) {
if (i > NUMA_NUM_NODES) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Host cannot support NUMA node %d"), i);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Host cannot support NUMA node %d"), i);
return -1;
}
if (i > maxnode && !warned) {
@ -1760,9 +1760,9 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm,
}
if (nnodes != 1) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("NUMA memory tuning in 'preferred' mode "
"only supports single node"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("NUMA memory tuning in 'preferred' mode "
"only supports single node"));
goto cleanup;
}
@ -1774,8 +1774,8 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm,
/* XXX: Shouldn't go here, as we already do checking when
* parsing domain XML.
*/
qemuReportError(VIR_ERR_XML_ERROR,
"%s", _("Invalid mode for memory NUMA tuning."));
virReportError(VIR_ERR_XML_ERROR,
"%s", _("Invalid mode for memory NUMA tuning."));
goto cleanup;
}
@ -1790,8 +1790,8 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm,
const char *nodemask ATTRIBUTE_UNUSED)
{
if (vm->def->numatune.memory.nodemask) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("libvirt is compiled without NUMA tuning support"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("libvirt is compiled without NUMA tuning support"));
return -1;
}
@ -1814,9 +1814,9 @@ qemuGetNumadAdvice(virDomainDefPtr def)
virCommandSetOutputBuffer(cmd, &output);
if (virCommandRun(cmd, NULL) < 0)
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Failed to query numad for the "
"advisory nodeset"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Failed to query numad for the "
"advisory nodeset"));
virCommandFree(cmd);
return output;
@ -1825,8 +1825,8 @@ qemuGetNumadAdvice(virDomainDefPtr def)
static char *
qemuGetNumadAdvice(virDomainDefPtr def ATTRIBUTE_UNUSED)
{
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("numad is not available on this host"));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("numad is not available on this host"));
return NULL;
}
#endif
@ -1920,8 +1920,8 @@ qemuProcessSetLinkStates(virDomainObjPtr vm)
VIR_DEBUG("Setting link state: %s", def->nets[i]->info.alias);
if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV)) {
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
_("Setting of link state is not supported by this qemu"));
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("Setting of link state is not supported by this qemu"));
return -1;
}
@ -1929,7 +1929,7 @@ qemuProcessSetLinkStates(virDomainObjPtr vm)
def->nets[i]->info.alias,
VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN);
if (ret != 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("Couldn't set link state on interface: %s"), def->nets[i]->info.alias);
break;
}
@ -1961,8 +1961,8 @@ qemuProcessSetVcpuAffinites(virConnectPtr conn,
return 0;
if (priv->vcpupids == NULL) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("cpu affinity is not supported"));
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("cpu affinity is not supported"));
return -1;
}
@ -2330,9 +2330,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
if (qemuProcessAssignNextPCIAddress(&(vm->def->disks[i]->info),
vendor, product,
addrs, naddrs) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for VirtIO disk %s"),
vm->def->disks[i]->dst);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for VirtIO disk %s"),
vm->def->disks[i]->dst);
return -1;
}
}
@ -2344,9 +2344,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
if (qemuProcessAssignNextPCIAddress(&(vm->def->nets[i]->info),
vendor, product,
addrs, naddrs) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for %s NIC"),
vm->def->nets[i]->model);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for %s NIC"),
vm->def->nets[i]->model);
return -1;
}
}
@ -2358,9 +2358,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
if (qemuProcessAssignNextPCIAddress(&(vm->def->controllers[i]->info),
vendor, product,
addrs, naddrs) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for controller %s"),
virDomainControllerTypeToString(vm->def->controllers[i]->type));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for controller %s"),
virDomainControllerTypeToString(vm->def->controllers[i]->type));
return -1;
}
}
@ -2372,9 +2372,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
if (qemuProcessAssignNextPCIAddress(&(vm->def->videos[i]->info),
vendor, product,
addrs, naddrs) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for video adapter %s"),
virDomainVideoTypeToString(vm->def->videos[i]->type));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for video adapter %s"),
virDomainVideoTypeToString(vm->def->videos[i]->type));
return -1;
}
}
@ -2386,9 +2386,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
if (qemuProcessAssignNextPCIAddress(&(vm->def->sounds[i]->info),
vendor, product,
addrs, naddrs) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for sound adapter %s"),
virDomainSoundModelTypeToString(vm->def->sounds[i]->model));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for sound adapter %s"),
virDomainSoundModelTypeToString(vm->def->sounds[i]->model));
return -1;
}
}
@ -2399,9 +2399,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
if (qemuProcessAssignNextPCIAddress(&(vm->def->watchdog->info),
vendor, product,
addrs, naddrs) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for watchdog %s"),
virDomainWatchdogModelTypeToString(vm->def->watchdog->model));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for watchdog %s"),
virDomainWatchdogModelTypeToString(vm->def->watchdog->model));
return -1;
}
}
@ -2411,9 +2411,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
if (qemuProcessAssignNextPCIAddress(&(vm->def->memballoon->info),
vendor, product,
addrs, naddrs) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for balloon %s"),
virDomainMemballoonModelTypeToString(vm->def->memballoon->model));
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for balloon %s"),
virDomainMemballoonModelTypeToString(vm->def->memballoon->model));
return -1;
}
}
@ -3273,9 +3273,9 @@ qemuProcessReconnectHelper(void *payload,
virConnectClose(data->conn);
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not create thread. QEMU initialization "
"might be incomplete"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not create thread. QEMU initialization "
"might be incomplete"));
if (qemuDomainObjEndJob(src->driver, obj) == 0) {
obj = NULL;
} else if (virDomainObjUnref(obj) > 0) {
@ -3354,8 +3354,8 @@ int qemuProcessStart(virConnectPtr conn,
VIR_DEBUG("Beginning VM startup process");
if (virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("VM is already active"));
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("VM is already active"));
return -1;
}
@ -3420,8 +3420,8 @@ int qemuProcessStart(virConnectPtr conn,
vm->def->graphics[0]->data.vnc.autoport) {
int port = qemuProcessNextFreePort(driver, QEMU_VNC_PORT_MIN);
if (port < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to find an unused VNC port"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to find an unused VNC port"));
goto cleanup;
}
vm->def->graphics[0]->data.vnc.port = port;
@ -3432,8 +3432,8 @@ int qemuProcessStart(virConnectPtr conn,
port = qemuProcessNextFreePort(driver, QEMU_VNC_PORT_MIN);
if (port < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to find an unused SPICE port"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to find an unused SPICE port"));
goto cleanup;
}
@ -3446,8 +3446,8 @@ int qemuProcessStart(virConnectPtr conn,
int tlsPort = qemuProcessNextFreePort(driver,
vm->def->graphics[0]->data.spice.port + 1);
if (tlsPort < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to find an unused SPICE TLS port"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to find an unused SPICE TLS port"));
qemuProcessReturnPort(driver, port);
goto cleanup;
}
@ -3492,10 +3492,10 @@ int qemuProcessStart(virConnectPtr conn,
if (vm->def->virtType == VIR_DOMAIN_VIRT_KVM) {
VIR_DEBUG("Checking for KVM availability");
if (access("/dev/kvm", F_OK) != 0) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Domain requires KVM, but it is not available. "
"Check that virtualization is enabled in the host BIOS, "
"and host configuration is setup to load the kvm modules."));
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Domain requires KVM, but it is not available. "
"Check that virtualization is enabled in the host BIOS, "
"and host configuration is setup to load the kvm modules."));
goto cleanup;
}
}
@ -3658,8 +3658,8 @@ int qemuProcessStart(virConnectPtr conn,
/* wait for qemu process to show up */
if (ret == 0) {
if (virPidFileReadPath(priv->pidfile, &vm->pid) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("Domain %s didn't show up"), vm->def->name);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Domain %s didn't show up"), vm->def->name);
ret = -1;
}
#if 0
@ -3790,9 +3790,9 @@ int qemuProcessStart(virConnectPtr conn,
VIR_DEBUG("Setting initial memory amount");
cur_balloon = vm->def->mem.cur_balloon;
if (cur_balloon != vm->def->mem.cur_balloon) {
qemuReportError(VIR_ERR_OVERFLOW,
_("unable to set balloon to %lld"),
vm->def->mem.cur_balloon);
virReportError(VIR_ERR_OVERFLOW,
_("unable to set balloon to %lld"),
vm->def->mem.cur_balloon);
goto cleanup;
}
qemuDomainObjEnterMonitorWithDriver(driver, vm);
@ -3809,8 +3809,8 @@ int qemuProcessStart(virConnectPtr conn,
VIR_DOMAIN_RUNNING_BOOTED,
QEMU_ASYNC_JOB_NONE) < 0) {
if (virGetLastError() == NULL)
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("resume operation failed"));
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("resume operation failed"));
goto cleanup;
}
} else {
@ -4199,8 +4199,8 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
VIR_DEBUG("Beginning VM attach process");
if (virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("VM is already active"));
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("VM is already active"));
return -1;
}