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

View File

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

View File

@ -310,7 +310,7 @@ int qemuSetupCgroup(struct qemud_driver *driver,
goto cleanup;
}
} else {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Block I/O tuning is not available on this host"));
goto cleanup;
}
@ -333,7 +333,7 @@ int qemuSetupCgroup(struct qemud_driver *driver,
}
}
} else {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Block I/O tuning is not available on this host"));
goto cleanup;
}
@ -372,7 +372,7 @@ int qemuSetupCgroup(struct qemud_driver *driver,
}
}
} else {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Memory cgroup is not available on this host"));
}
}
@ -387,7 +387,7 @@ int qemuSetupCgroup(struct qemud_driver *driver,
goto cleanup;
}
} else {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("CPU tuning is not available on this host"));
}
}
@ -405,7 +405,7 @@ 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",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("failed to convert memory nodemask"));
goto cleanup;
}
@ -585,7 +585,7 @@ 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,
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,7 +140,7 @@ int qemudLoadDriverConfig(struct qemud_driver *driver,
#define CHECK_TYPE(name,typ) if (p && p->type != (typ)) { \
qemuReportError(VIR_ERR_INTERNAL_ERROR, \
virReportError(VIR_ERR_INTERNAL_ERROR, \
"%s: %s: expected type " #typ, \
filename, (name)); \
virConfFree(conf); \
@ -535,14 +535,14 @@ qemuDriverCloseCallbackSet(struct qemud_driver *driver,
closeDef = virHashLookup(driver->closeCallbacks, uuidstr);
if (closeDef) {
if (closeDef->conn != conn) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Another close callback is already defined for"
" domain %s"), vm->def->name);
return -1;
@ -582,7 +582,7 @@ qemuDriverCloseCallbackUnset(struct qemud_driver *driver,
return -1;
if (closeDef->cb && closeDef->cb != cb) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
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,7 +344,7 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
if (!(monitorpath =
virXPathString("string(./monitor[1]/@path)", ctxt))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("no monitor path"));
goto error;
}
@ -371,7 +371,7 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
break;
default:
VIR_FREE(monitorpath);
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unsupported monitor type '%s'"),
virDomainChrTypeToString(priv->monConfig->type));
goto error;
@ -402,7 +402,7 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
}
if ((n = virXPathNodeSet("./qemuCaps/flag", ctxt, &nodes)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("failed to parse qemu capabilities flags"));
goto error;
}
@ -415,7 +415,7 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
if (str) {
int flag = qemuCapsTypeFromString(str);
if (flag < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown qemu capabilities flag %s"), str);
VIR_FREE(str);
goto error;
@ -435,7 +435,7 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
int type;
if ((type = qemuDomainJobTypeFromString(tmp)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown job type %s"), tmp);
VIR_FREE(tmp);
goto error;
@ -448,7 +448,7 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
int async;
if ((async = qemuDomainAsyncJobTypeFromString(tmp)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown async job type %s"), tmp);
VIR_FREE(tmp);
goto error;
@ -459,7 +459,7 @@ 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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown job phase %s"), tmp);
VIR_FREE(tmp);
goto error;
@ -514,7 +514,7 @@ 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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to register xml namespace '%s'"),
QEMU_NAMESPACE_HREF);
return -1;
@ -537,7 +537,7 @@ 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,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("No qemu command-line argument specified"));
goto error;
}
@ -563,22 +563,22 @@ qemuDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED,
tmp = virXMLPropString(nodes[i], "name");
if (tmp == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("No qemu environment name specified"));
goto error;
}
if (tmp[0] == '\0') {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
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,
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,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Invalid environment name, it must contain only alphanumerics and underscore"));
goto error;
}
@ -838,11 +838,11 @@ error:
priv->job.owner, priv->job.asyncOwner);
if (errno == ETIMEDOUT)
qemuReportError(VIR_ERR_OPERATION_TIMEOUT,
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,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("cannot acquire state change lock "
"due to max_queued limit"));
else
@ -899,7 +899,7 @@ int qemuDomainObjBeginJobWithDriver(struct qemud_driver *driver,
enum qemuDomainJob job)
{
if (job <= QEMU_JOB_NONE || job >= QEMU_JOB_ASYNC) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Attempt to start invalid job"));
return -1;
}
@ -971,7 +971,7 @@ qemuDomainObjEnterMonitorInternal(struct qemud_driver *driver,
if (asyncJob != QEMU_ASYNC_JOB_NONE) {
if (asyncJob != priv->job.asyncJob) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected async job %d"), asyncJob);
return -1;
}
@ -983,7 +983,7 @@ qemuDomainObjEnterMonitorInternal(struct qemud_driver *driver,
QEMU_ASYNC_JOB_NONE) < 0)
return -1;
if (!virDomainObjIsActive(obj)) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("domain is no longer running"));
/* Still referenced by the containing async job. */
ignore_value(qemuDomainObjEndJob(driver, obj));
@ -1241,7 +1241,7 @@ 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,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("cannot get host CPU capabilities"));
goto cleanup;
}
@ -1575,7 +1575,7 @@ qemuFindQemuImgBinary(struct qemud_driver *driver)
if (!driver->qemuImgBinary)
driver->qemuImgBinary = virFindFileInPath("qemu-img");
if (!driver->qemuImgBinary)
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("unable to find kvm-img or qemu-img"));
}
@ -1672,7 +1672,7 @@ qemuDomainSnapshotForEachQcow2Raw(struct qemud_driver *driver,
qemuDomainSnapshotForEachQcow2Raw(driver, def, name,
"-d", false, i);
}
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("Disk device '%s' does not support"
" snapshotting"),
def->disks[i]->dst);

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,7 +273,8 @@ 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 "
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("virtualport type %s is "
"currently not supported on interfaces of type "
"hostdev"),
virNetDevVPortTypeToString(virtPort->virtPortType));
@ -307,7 +310,7 @@ qemuDomainHostdevNetConfigReplace(virDomainHostdevDefPtr hostdev,
isvf = qemuDomainHostdevIsVirtualFunction(hostdev);
if (isvf <= 0) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Interface type hostdev is currently supported on"
" SR-IOV Virtual Functions only"));
return ret;
@ -345,7 +348,7 @@ qemuDomainHostdevNetConfigRestore(virDomainHostdevDefPtr hostdev,
isvf = qemuDomainHostdevIsVirtualFunction(hostdev);
if (isvf <= 0) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Interface type hostdev is currently supported on"
" SR-IOV Virtual Functions only"));
return ret;
@ -399,7 +402,7 @@ int qemuPrepareHostdevPCIDevices(struct qemud_driver *driver,
pciDevice *other;
if (!pciDeviceIsAssignable(dev, !driver->relaxedACS)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("PCI device %s is not assignable"),
pciDeviceGetName(dev));
goto cleanup;
@ -411,11 +414,11 @@ int qemuPrepareHostdevPCIDevices(struct qemud_driver *driver,
const char *other_name = pciDeviceGetUsedBy(other);
if (other_name)
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("PCI device %s is in use by domain %s"),
pciDeviceGetName(dev), other_name);
else
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("PCI device %s is already in use"),
pciDeviceGetName(dev));
goto cleanup;
@ -579,11 +582,11 @@ qemuPrepareHostdevUSBDevices(struct qemud_driver *driver,
const char *other_name = usbDeviceGetUsedBy(tmp);
if (other_name)
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("USB device %s is in use by domain %s"),
usbDeviceGetName(tmp), other_name);
else
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("USB device %s is already in use"),
usbDeviceGetName(tmp));
goto error;
@ -653,7 +656,7 @@ qemuPrepareHostUSBDevices(struct qemud_driver *driver,
goto cleanup;
if (usbDeviceListCount(devs) > 1) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("multiple USB devices for %x:%x, "
"use <address> to specify one"), vendor, product);
usbDeviceListFree(devs);

View File

@ -66,7 +66,7 @@ int qemuDomainChangeEjectableMedia(struct qemud_driver *driver,
}
if (!origdisk) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("No device with bus '%s' and target '%s'"),
virDomainDiskBusTypeToString(disk->bus),
disk->dst);
@ -74,14 +74,14 @@ int qemuDomainChangeEjectableMedia(struct qemud_driver *driver,
}
if (!origdisk->info.alias) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Removable media not supported for %s device"),
virDomainDiskDeviceTypeToString(disk->device));
return -1;
@ -210,7 +210,7 @@ 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,
virReportError(VIR_ERR_OPERATION_FAILED,
_("target %s already exists"), disk->dst);
return -1;
}
@ -318,7 +318,7 @@ 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,
virReportError(VIR_ERR_OPERATION_FAILED,
_("target %s:%d already exists"),
type, controller->idx);
return -1;
@ -335,7 +335,7 @@ 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",
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("USB controller hotplug unsupported in this QEMU binary"));
goto cleanup;
}
@ -415,7 +415,7 @@ qemuDomainFindOrCreateSCSIDiskController(struct qemud_driver *driver,
}
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
/* cont doesn't need freeing here, since the reference
* now held in def->controllers */
@ -440,7 +440,7 @@ 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,
virReportError(VIR_ERR_OPERATION_FAILED,
_("target %s already exists"), disk->dst);
return -1;
}
@ -458,7 +458,7 @@ 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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected disk address type %s"),
virDomainDeviceAddressTypeToString(disk->info.type));
goto error;
@ -486,7 +486,7 @@ int qemuDomainAttachSCSIDisk(virConnectPtr conn,
sa_assert (cont);
if (cont->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("SCSI controller %d was missing its PCI address"), cont->idx);
goto error;
}
@ -563,7 +563,7 @@ 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,
virReportError(VIR_ERR_OPERATION_FAILED,
_("target %s already exists"), disk->dst);
return -1;
}
@ -581,7 +581,7 @@ int qemuDomainAttachUsbMassstorageDevice(virConnectPtr conn,
/* XXX not correct once we allow attaching a USB CDROM */
if (!disk->src) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("disk source path is missing"));
goto error;
}
@ -692,7 +692,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
}
if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_HOST_NET_ADD)) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("installed qemu version does not support host_net_add"));
goto cleanup;
}
@ -734,7 +734,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
vlan = qemuDomainNetVLAN(net);
if (vlan < 0) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Unable to attach network devices without vlan"));
goto cleanup;
}
@ -784,7 +784,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
VIR_FORCE_CLOSE(vhostfd);
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
goto cleanup;
}
@ -820,7 +820,7 @@ 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",
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("device alias not found: cannot set link state to down"));
} else {
qemuDomainObjEnterMonitorWithDriver(driver, vm);
@ -832,7 +832,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
goto try_remove;
}
} else {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("setting of link state not supported: Link is up"));
}
@ -953,7 +953,7 @@ int qemuDomainAttachHostPciDevice(struct qemud_driver *driver,
}
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit during hotplug"));
goto error;
}
@ -1077,7 +1077,7 @@ int qemuDomainAttachHostUsbDevice(struct qemud_driver *driver,
qemuCgroupData data;
if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) !=0 ) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find cgroup for %s"),
vm->def->name);
goto error;
@ -1124,7 +1124,7 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver,
usbDevice *usb = NULL;
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("hostdev mode '%s' not supported"),
virDomainHostdevModeTypeToString(hostdev->mode));
return -1;
@ -1148,7 +1148,7 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver,
goto cleanup;
if (usbDeviceListCount(devs) > 1) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("multiple USB devices for %x:%x, "
"use <address> to specify one"), vendor, product);
usbDeviceListFree(devs);
@ -1199,7 +1199,7 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver,
break;
default:
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("hostdev subsys type '%s' not supported"),
virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type));
goto error;
@ -1246,7 +1246,7 @@ int qemuDomainChangeNetBridge(virDomainObjPtr vm,
olddev->ifname, oldbridge, newbridge);
if (virNetDevExists(newbridge) != 1) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("bridge %s doesn't exist"), newbridge);
return -1;
}
@ -1268,7 +1268,7 @@ int qemuDomainChangeNetBridge(virDomainObjPtr vm,
ret = virNetDevBridgeAddPort(oldbridge, olddev->ifname);
virDomainAuditNet(vm, NULL, olddev, "attach", ret == 0);
if (ret < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("unable to recover former state by adding port"
"to bridge %s"), oldbridge);
}
@ -1291,7 +1291,7 @@ 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",
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("can't change link state: device alias not found"));
return -1;
}
@ -1321,13 +1321,13 @@ int qemuDomainChangeNet(struct qemud_driver *driver,
int ret = 0;
if (!olddev) {
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
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",
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot change network interface type"));
return -1;
}
@ -1340,7 +1340,7 @@ 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",
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify ethernet network device configuration"));
return -1;
}
@ -1351,7 +1351,7 @@ 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",
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify network socket device configuration"));
return -1;
}
@ -1361,7 +1361,7 @@ 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",
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify network device configuration"));
return -1;
}
@ -1372,7 +1372,7 @@ 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",
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify bridge network device configuration"));
return -1;
}
@ -1380,7 +1380,7 @@ int qemuDomainChangeNet(struct qemud_driver *driver,
case VIR_DOMAIN_NET_TYPE_INTERNAL:
if (STRNEQ_NULLABLE(olddev->data.internal.name, dev->data.internal.name)) {
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify internal network device configuration"));
return -1;
}
@ -1390,14 +1390,14 @@ 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",
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify direct network device configuration"));
return -1;
}
break;
default:
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to change config on '%s' network type"),
virDomainNetTypeToString(dev->type));
break;
@ -1407,7 +1407,7 @@ 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",
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify network device configuration"));
return -1;
}
@ -1415,7 +1415,7 @@ int qemuDomainChangeNet(struct qemud_driver *driver,
/* 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",
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("cannot modify network device configuration"));
return -1;
}
@ -1462,7 +1462,7 @@ qemuDomainChangeGraphics(struct qemud_driver *driver,
int ret = -1;
if (!olddev) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot find existing graphics device to modify"));
return -1;
}
@ -1477,22 +1477,22 @@ 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",
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",
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",
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",
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",
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",
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",
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,7 +1584,7 @@ qemuDomainChangeGraphics(struct qemud_driver *driver,
break;
default:
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to change config on '%s' graphics type"),
virDomainGraphicsTypeToString(dev->type));
break;
@ -1646,7 +1646,7 @@ int qemuDomainDetachPciDiskDevice(struct qemud_driver *driver,
i = qemuFindDisk(vm->def, dev->data.disk->dst);
if (i < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("disk %s not found"), dev->data.disk->dst);
goto cleanup;
}
@ -1654,7 +1654,7 @@ int qemuDomainDetachPciDiskDevice(struct qemud_driver *driver,
detach = vm->def->disks[i];
if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("cannot hot unplug multifunction PCI device: %s"),
dev->data.disk->dst);
goto cleanup;
@ -1662,7 +1662,7 @@ int qemuDomainDetachPciDiskDevice(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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find cgroup for %s"),
vm->def->name);
goto cleanup;
@ -1671,7 +1671,7 @@ int qemuDomainDetachPciDiskDevice(struct qemud_driver *driver,
if (!virDomainDeviceAddressIsValid(&detach->info,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("device cannot be detached without a PCI address"));
goto cleanup;
}
@ -1750,13 +1750,13 @@ int qemuDomainDetachDiskDevice(struct qemud_driver *driver,
i = qemuFindDisk(vm->def, dev->data.disk->dst);
if (i < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
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,
virReportError(VIR_ERR_OPERATION_FAILED,
_("Underlying qemu does not support %s disk removal"),
virDomainDiskBusTypeToString(dev->data.disk->bus));
goto cleanup;
@ -1766,7 +1766,7 @@ 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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find cgroup for %s"),
vm->def->name);
goto cleanup;
@ -1887,7 +1887,7 @@ int qemuDomainDetachPciControllerDevice(struct qemud_driver *driver,
}
if (!detach) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("disk controller %s:%d not found"),
virDomainControllerTypeToString(dev->data.controller->type),
dev->data.controller->idx);
@ -1896,20 +1896,20 @@ int qemuDomainDetachPciControllerDevice(struct qemud_driver *driver,
if (!virDomainDeviceAddressIsValid(&detach->info,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
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,
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",
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("device cannot be detached: device is busy"));
goto cleanup;
}
@ -1973,7 +1973,7 @@ qemuDomainDetachHostPciDevice(struct qemud_driver *driver,
pciDevice *activePci;
if (qemuIsMultiFunctionDevice(vm->def, detach->info)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
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);
@ -1982,7 +1982,7 @@ qemuDomainDetachHostPciDevice(struct qemud_driver *driver,
if (!virDomainDeviceAddressIsValid(detach->info,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("device cannot be detached without a PCI address"));
return -1;
}
@ -2042,13 +2042,13 @@ qemuDomainDetachHostUsbDevice(struct qemud_driver *driver,
int ret;
if (!detach->info->alias) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
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,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("device cannot be detached with this QEMU version"));
return -1;
}
@ -2088,7 +2088,7 @@ int qemuDomainDetachThisHostDevice(struct qemud_driver *driver,
break;
}
if (idx >= vm->def->nhostdevs) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("device not found in hostdevs list (%d entries)"),
vm->def->nhostdevs);
return ret;
@ -2103,7 +2103,7 @@ int qemuDomainDetachThisHostDevice(struct qemud_driver *driver,
ret = qemuDomainDetachHostUsbDevice(driver, vm, detach);
break;
default:
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("hostdev subsys type '%s' not supported"),
virDomainHostdevSubsysTypeToString(detach->source.subsys.type));
return -1;
@ -2131,7 +2131,7 @@ int qemuDomainDetachHostDevice(struct qemud_driver *driver,
int idx;
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("hostdev mode '%s' not supported"),
virDomainHostdevModeTypeToString(hostdev->mode));
return -1;
@ -2142,24 +2142,24 @@ int qemuDomainDetachHostDevice(struct qemud_driver *driver,
if (idx < 0) {
switch(subsys->type) {
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
qemuReportError(VIR_ERR_OPERATION_FAILED,
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,
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,
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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected hostdev type %d"), subsys->type);
break;
}
@ -2197,7 +2197,7 @@ qemuDomainDetachNetDevice(struct qemud_driver *driver,
}
if (!detach) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
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],
@ -2214,20 +2214,20 @@ qemuDomainDetachNetDevice(struct qemud_driver *driver,
if (!virDomainDeviceAddressIsValid(&detach->info,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
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,
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,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("unable to determine original VLAN"));
goto cleanup;
}
@ -2341,7 +2341,7 @@ qemuDomainChangeGraphicsPasswords(struct qemud_driver *driver,
if (ret == -2) {
if (type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Graphics password only supported for VNC"));
ret = -1;
} else {
@ -2367,7 +2367,7 @@ 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",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Expiry of passwords is not supported"));
ret = -1;
} else {
@ -2405,7 +2405,7 @@ int qemuDomainDetachLease(struct qemud_driver *driver,
int i;
if ((i = virDomainLeaseIndex(vm->def, lease)) < 0) {
qemuReportError(VIR_ERR_INVALID_ARG,
virReportError(VIR_ERR_INVALID_ARG,
_("Lease %s in lockspace %s does not exist"),
lease->key, NULLSTR(lease->lockspace));
return -1;

View File

@ -164,14 +164,14 @@ qemuDomainExtractTLSSubject(const char *certdir)
goto no_memory;
if (virFileReadAll(certfile, 8192, &pemdata) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot initialize cert object: %s"),
gnutls_strerror(ret));
goto error;
@ -182,7 +182,7 @@ qemuDomainExtractTLSSubject(const char *certdir)
ret = gnutls_x509_crt_import(cert, &pemdatum, GNUTLS_X509_FMT_PEM);
if (ret < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot load cert data from %s: %s"),
certfile, gnutls_strerror(ret));
goto error;
@ -277,7 +277,7 @@ qemuMigrationCookieNew(virDomainObjPtr dom)
if (!(mig->localHostname = virGetHostname(NULL)))
goto error;
if (virGetHostUUID(mig->localHostuuid) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to obtain host UUID"));
goto error;
}
@ -298,7 +298,7 @@ qemuMigrationCookieAddGraphics(qemuMigrationCookiePtr mig,
virDomainObjPtr dom)
{
if (mig->flags & QEMU_MIGRATION_COOKIE_GRAPHICS) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Migration graphics data already present"));
return -1;
}
@ -324,7 +324,7 @@ qemuMigrationCookieAddLockstate(qemuMigrationCookiePtr mig,
qemuDomainObjPrivatePtr priv = dom->privateData;
if (mig->flags & QEMU_MIGRATION_COOKIE_LOCKSTATE) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Migration lockstate data already present"));
return -1;
}
@ -355,7 +355,7 @@ qemuMigrationCookieAddPersistent(qemuMigrationCookiePtr mig,
virDomainObjPtr dom)
{
if (mig->flags & QEMU_MIGRATION_COOKIE_PERSISTENT) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Migration persistent data already present"));
return -1;
}
@ -474,31 +474,31 @@ qemuMigrationCookieGraphicsXMLParse(xmlXPathContextPtr ctxt)
goto no_memory;
if (!(tmp = virXPathString("string(./graphics/@type)", ctxt))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
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,
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,
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,
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,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing listen attribute in migration data"));
goto error;
}
@ -535,12 +535,12 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
/* Extract domain name */
if (!(tmp = virXPathString("string(./name[1])", ctxt))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing name element in migration data"));
goto error;
}
if (STRNEQ(tmp, mig->name)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Incoming cookie data had unexpected name %s vs %s"),
tmp, mig->name);
goto error;
@ -550,13 +550,13 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
/* Extract domain uuid */
tmp = virXPathString("string(./uuid[1])", ctxt);
if (!tmp) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Incoming cookie data had unexpected UUID %s vs %s"),
tmp, uuidstr);
}
@ -564,29 +564,29 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
/* Check & forbid "localhost" migration */
if (!(mig->remoteHostname = virXPathString("string(./hostname[1])", ctxt))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
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,
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,
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,
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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Attempt to migrate guest to the same host %s"),
tmp);
goto error;
@ -602,13 +602,13 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
int val;
char *str = virXMLPropString(nodes[i], "name");
if (!str) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("missing feature name"));
goto error;
}
if ((val = qemuMigrationCookieFlagTypeFromString(str)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown migration cookie feature %s"),
str);
VIR_FREE(str);
@ -616,7 +616,7 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
}
if ((flags & (1 << val)) == 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unsupported migration cookie feature %s"),
str);
VIR_FREE(str);
@ -634,7 +634,7 @@ 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",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing lock driver name in migration cookie"));
goto error;
}
@ -646,7 +646,7 @@ 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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Too many domain elements in "
"migration cookie: %d"),
n);
@ -744,7 +744,7 @@ qemuMigrationEatCookie(struct qemud_driver *driver,
/* Parse & validate incoming cookie (if any) */
if (cookiein && cookieinlen &&
cookiein[cookieinlen-1] != '\0') {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Migration cookie was not NULL terminated"));
goto error;
}
@ -764,14 +764,14 @@ qemuMigrationEatCookie(struct qemud_driver *driver,
if (mig->flags & QEMU_MIGRATION_COOKIE_LOCKSTATE) {
if (!mig->lockDriver) {
if (virLockManagerPluginUsesState(driver->lockManager)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Source host lock driver %s different from target %s"),
mig->lockDriver,
virLockManagerPluginGetName(driver->lockManager));
@ -803,13 +803,13 @@ qemuMigrationIsAllowed(struct qemud_driver *driver, virDomainObjPtr vm,
if (vm) {
if (qemuProcessAutoDestroyActive(driver, vm)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
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,
virReportError(VIR_ERR_OPERATION_INVALID,
_("cannot migrate domain with %d snapshots"),
nsnapshots);
return false;
@ -818,7 +818,7 @@ qemuMigrationIsAllowed(struct qemud_driver *driver, virDomainObjPtr vm,
def = vm->def;
}
if (def->nhostdevs > 0) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("Domain with assigned host devices cannot be migrated"));
return false;
}
@ -852,7 +852,7 @@ qemuMigrationIsSafe(virDomainDefPtr def)
continue;
}
qemuReportError(VIR_ERR_MIGRATE_UNSAFE, "%s",
virReportError(VIR_ERR_MIGRATE_UNSAFE, "%s",
_("Migration may lead to data corruption if disks"
" use cache != none"));
return false;
@ -922,7 +922,7 @@ 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,
virReportError(VIR_ERR_OPERATION_FAILED,
_("%s: %s"), job, _("is not active"));
break;
@ -945,13 +945,13 @@ qemuMigrationUpdateJobStatus(struct qemud_driver *driver,
case QEMU_MONITOR_MIGRATION_STATUS_ERROR:
priv->job.info.type = VIR_DOMAIN_JOB_FAILED;
qemuReportError(VIR_ERR_OPERATION_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,
virReportError(VIR_ERR_OPERATION_ABORTED,
_("%s: %s"), job, _("canceled by client"));
break;
}
@ -992,7 +992,7 @@ qemuMigrationWaitForCompletion(struct qemud_driver *driver, virDomainObjPtr vm,
goto cleanup;
if (dconn && virConnectIsAlive(dconn) <= 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Lost connection to destination host"));
goto cleanup;
}
@ -1158,7 +1158,7 @@ char *qemuMigrationBegin(struct qemud_driver *driver,
goto cleanup;
if (STRNEQ(def->name, vm->def->name)) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("target domain name doesn't match source name"));
goto cleanup;
}
@ -1371,7 +1371,7 @@ qemuMigrationPrepareAny(struct qemud_driver *driver,
*/
if (qemuMigrationJobContinue(vm) == 0) {
vm = NULL;
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("domain disappeared"));
goto cleanup;
}
@ -1480,7 +1480,7 @@ qemuMigrationPrepareDirect(struct qemud_driver *driver,
goto cleanup;
if (STRPREFIX(hostname, "localhost")) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("hostname on destination resolved to localhost,"
" but migration requires an FQDN"));
goto cleanup;
@ -1502,7 +1502,7 @@ qemuMigrationPrepareDirect(struct qemud_driver *driver,
* characters in hostname part don't matter.
*/
if (!STRPREFIX (uri_in, "tcp:")) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("only tcp URIs are supported for KVM/QEMU"
" migrations"));
goto cleanup;
@ -1526,7 +1526,7 @@ 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,
virReportError(VIR_ERR_INVALID_ARG,
"%s", _("URI ended with incorrect ':port'"));
goto cleanup;
}
@ -1850,7 +1850,7 @@ qemuMigrationRun(struct qemud_driver *driver,
if (virLockManagerPluginUsesState(driver->lockManager) &&
!cookieout) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Migration with lock driver %s requires"
" cookie support"),
virLockManagerPluginGetName(driver->lockManager));
@ -1932,7 +1932,7 @@ qemuMigrationRun(struct qemud_driver *driver,
ret = -1;
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
goto cleanup;
}
@ -2102,7 +2102,7 @@ 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",
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Source qemu is too old to support tunnelled migration"));
return -1;
}
@ -2233,14 +2233,14 @@ static int doPeer2PeerMigrate2(struct qemud_driver *driver,
* in qemuDomainObjEnterRemoteWithDriver, so check again
*/
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
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",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("domainMigratePrepare2 did not set uri"));
cancelled = 1;
goto finish;
@ -2378,7 +2378,7 @@ static int doPeer2PeerMigrate3(struct qemud_driver *driver,
if (!(flags & VIR_MIGRATE_TUNNELLED) &&
(uri_out == NULL)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("domainMigratePrepare3 did not set uri"));
cancelled = 1;
goto finish;
@ -2529,7 +2529,7 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver,
dconn = virConnectOpen(dconnuri);
qemuDomainObjExitRemoteWithDriver(driver, vm);
if (dconn == NULL) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("Failed to connect to remote libvirt URI %s"), dconnuri);
return -1;
}
@ -2550,14 +2550,14 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver,
qemuDomainObjExitRemoteWithDriver(driver, vm);
if (!p2p) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
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",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
goto cleanup;
}
@ -2620,7 +2620,7 @@ qemuMigrationPerformJob(struct qemud_driver *driver,
goto cleanup;
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
goto endjob;
}
@ -2816,7 +2816,7 @@ qemuMigrationPerform(struct qemud_driver *driver,
if ((flags & (VIR_MIGRATE_TUNNELLED | VIR_MIGRATE_PEER2PEER))) {
if (cookieinlen) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("received unexpected cookie with P2P migration"));
return -1;
}
@ -2827,7 +2827,7 @@ qemuMigrationPerform(struct qemud_driver *driver,
v3proto);
} else {
if (dconnuri) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unexpected dconnuri parameter with non-peer2peer migration"));
return -1;
}
@ -2863,7 +2863,7 @@ qemuMigrationVPAssociatePortProfiles(virDomainDefPtr def) {
def->uuid,
VIR_NETDEV_VPORT_PROFILE_OP_MIGRATE_IN_FINISH,
false) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("Port profile Associate failed for %s"),
net->ifname);
goto err_exit;
@ -2943,7 +2943,7 @@ qemuMigrationFinish(struct qemud_driver *driver,
*/
if (retcode == 0) {
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
goto endjob;
}
@ -2990,7 +2990,7 @@ qemuMigrationFinish(struct qemud_driver *driver,
vm->persistent = 0;
}
if (!vmdef)
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("can't get vmdef"));
goto endjob;
}
@ -3014,7 +3014,7 @@ qemuMigrationFinish(struct qemud_driver *driver,
VIR_DOMAIN_RUNNING_MIGRATED,
QEMU_ASYNC_JOB_MIGRATION_IN) < 0) {
if (virGetLastError() == NULL)
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("resume operation failed"));
/* Need to save the current error, in case shutting
* down the process overwrites it
@ -3144,7 +3144,7 @@ int qemuMigrationConfirm(struct qemud_driver *driver,
VIR_DOMAIN_RUNNING_MIGRATED,
QEMU_ASYNC_JOB_MIGRATION_OUT) < 0) {
if (virGetLastError() == NULL)
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("resume operation failed"));
goto cleanup;
}
@ -3214,7 +3214,7 @@ 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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to find cgroup for %s"),
vm->def->name);
goto cleanup;
@ -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,7 +286,7 @@ 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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Monitor path %s too big for destination"), monitor);
goto error;
}
@ -329,7 +329,7 @@ qemuMonitorOpenPty(const char *monitor)
int monfd;
if ((monfd = open(monitor, O_RDWR)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to open monitor path %s"), monitor);
return -1;
}
@ -451,7 +451,7 @@ qemuMonitorIOWrite(qemuMonitorPtr mon)
return 0;
if (mon->msg->txFD != -1 && !mon->hasSendFD) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Monitor does not support sending of file descriptors"));
return -1;
}
@ -577,7 +577,7 @@ 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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("event from unexpected fd %d!=%d / watch %d!=%d"),
mon->fd, fd, mon->watch, watch);
error = true;
@ -612,7 +612,7 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) {
if (!error &&
events & VIR_EVENT_HANDLE_HANGUP) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("End of file from monitor"));
eof = 1;
events &= ~VIR_EVENT_HANDLE_HANGUP;
@ -620,13 +620,13 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) {
if (!error && !eof &&
events & VIR_EVENT_HANDLE_ERROR) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unhandled event %d for monitor fd %d"),
events, mon->fd);
error = 1;
@ -640,7 +640,7 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) {
} else {
virErrorPtr err = virGetLastError();
if (!err)
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Error while processing monitor IO"));
virCopyLastError(&mon->lastError);
virResetLastError();
@ -698,7 +698,7 @@ qemuMonitorOpen(virDomainObjPtr vm,
qemuMonitorPtr mon;
if (!cb || !cb->eofNotify) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("EOF notify callback must be supplied"));
return NULL;
}
@ -709,13 +709,13 @@ qemuMonitorOpen(virDomainObjPtr vm,
}
if (virMutexInit(&mon->lock) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
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",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot initialize monitor condition"));
virMutexDestroy(&mon->lock);
VIR_FREE(mon);
@ -739,7 +739,7 @@ qemuMonitorOpen(virDomainObjPtr vm,
break;
default:
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to handle monitor type: %s"),
virDomainChrTypeToString(config->type));
goto cleanup;
@ -748,12 +748,12 @@ qemuMonitorOpen(virDomainObjPtr vm,
if (mon->fd == -1) goto cleanup;
if (virSetCloseExec(mon->fd) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
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,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to put monitor into non-blocking mode"));
goto cleanup;
}
@ -765,7 +765,7 @@ qemuMonitorOpen(virDomainObjPtr vm,
VIR_EVENT_HANDLE_READABLE,
qemuMonitorIO,
mon, qemuMonitorUnwatch)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("unable to register monitor events"));
goto cleanup;
}
@ -813,7 +813,7 @@ void qemuMonitorClose(qemuMonitorPtr mon)
if (mon->lastError.code == VIR_ERR_OK) {
virErrorPtr err = virSaveLastError();
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Qemu monitor was closed"));
virCopyLastError(&mon->lastError);
if (err) {
@ -866,7 +866,7 @@ int qemuMonitorSend(qemuMonitorPtr mon,
while (!mon->msg->finished) {
if (virCondWait(&mon->notify, &mon->lock) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to wait on monitor condition"));
goto cleanup;
}
@ -902,7 +902,7 @@ 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",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to unescape command"));
goto cleanup;
}
@ -1105,7 +1105,7 @@ int qemuMonitorSetCapabilities(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1155,7 +1155,7 @@ qemuMonitorStartCPUs(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1175,7 +1175,7 @@ qemuMonitorStopCPUs(qemuMonitorPtr mon)
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1197,7 +1197,7 @@ qemuMonitorGetStatus(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p, running=%p, reason=%p", mon, running, reason);
if (!mon || !running) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("both monitor and running must not be NULL"));
return -1;
}
@ -1216,7 +1216,7 @@ int qemuMonitorSystemPowerdown(qemuMonitorPtr mon)
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1235,7 +1235,7 @@ int qemuMonitorSystemReset(qemuMonitorPtr mon)
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1255,7 +1255,7 @@ int qemuMonitorGetCPUInfo(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1275,7 +1275,7 @@ 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",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor || name must not be NULL"));
return -1;
}
@ -1294,7 +1294,7 @@ int qemuMonitorGetVirtType(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1314,7 +1314,7 @@ int qemuMonitorGetBalloonInfo(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1335,7 +1335,7 @@ int qemuMonitorGetMemoryStats(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p stats=%p nstats=%u", mon, stats, nr_stats);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1353,7 +1353,7 @@ qemuMonitorBlockIOStatusToError(const char *status)
int st = qemuMonitorBlockIOStatusTypeFromString(status);
if (st < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown block IO status: %s"), status);
return -1;
}
@ -1382,7 +1382,7 @@ qemuMonitorGetBlockInfo(qemuMonitorPtr mon)
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return NULL;
}
@ -1412,7 +1412,7 @@ qemuMonitorBlockInfoLookup(virHashTablePtr blockInfo,
VIR_DEBUG("blockInfo=%p dev=%s", blockInfo, NULLSTR(devname));
if (!(info = virHashLookup(blockInfo, devname))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find info for device '%s'"),
NULLSTR(devname));
}
@ -1436,7 +1436,7 @@ int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p dev=%s", mon, dev_name);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1472,7 +1472,7 @@ int qemuMonitorGetBlockStatsParamsNumber(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p nparams=%p", mon, nparams);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1525,7 +1525,7 @@ int qemuMonitorSetVNCPassword(qemuMonitorPtr mon,
mon, password);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1548,7 +1548,7 @@ static const char* qemuMonitorTypeToProtocol(int type)
case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
return "spice";
default:
qemuReportError(VIR_ERR_INVALID_ARG,
virReportError(VIR_ERR_INVALID_ARG,
_("unsupported protocol type %s"),
virDomainGraphicsTypeToString(type));
return NULL;
@ -1571,7 +1571,7 @@ int qemuMonitorSetPassword(qemuMonitorPtr mon,
mon, protocol, password, action_if_connected);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1603,7 +1603,7 @@ int qemuMonitorExpirePassword(qemuMonitorPtr mon,
mon, protocol, expire_time);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1625,7 +1625,7 @@ int qemuMonitorSetBalloon(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p newmem=%lu", mon, newmem);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1644,7 +1644,7 @@ 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",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1665,7 +1665,7 @@ 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",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1688,7 +1688,7 @@ int qemuMonitorChangeMedia(qemuMonitorPtr mon,
mon, dev_name, newmedia, format);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1711,7 +1711,7 @@ int qemuMonitorSaveVirtualMemory(qemuMonitorPtr mon,
mon, offset, length, path);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1733,7 +1733,7 @@ int qemuMonitorSavePhysicalMemory(qemuMonitorPtr mon,
mon, offset, length, path);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1753,7 +1753,7 @@ int qemuMonitorSetMigrationSpeed(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p bandwidth=%lu", mon, bandwidth);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1773,7 +1773,7 @@ int qemuMonitorSetMigrationDowntime(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p downtime=%llu", mon, downtime);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1796,7 +1796,7 @@ int qemuMonitorGetMigrationStatus(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1824,7 +1824,7 @@ int qemuMonitorMigrateToFd(qemuMonitorPtr mon,
mon, fd, flags);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1857,7 +1857,7 @@ int qemuMonitorMigrateToHost(qemuMonitorPtr mon,
mon, hostname, port, flags);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1889,7 +1889,7 @@ int qemuMonitorMigrateToCommand(qemuMonitorPtr mon,
mon, argv, flags);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -1931,13 +1931,13 @@ int qemuMonitorMigrateToFile(qemuMonitorPtr mon,
mon, argv, target, offset, flags);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("file offset must be a multiple of %llu"),
QEMU_MONITOR_MIGRATE_TO_FILE_BS);
return -1;
@ -1996,7 +1996,7 @@ int qemuMonitorMigrateToUnix(qemuMonitorPtr mon,
mon, unixfile, flags);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2021,7 +2021,7 @@ int qemuMonitorMigrateCancel(qemuMonitorPtr mon)
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2044,7 +2044,7 @@ int qemuMonitorDumpToFd(qemuMonitorPtr mon,
mon, fd, flags, begin, length);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2053,7 +2053,7 @@ int qemuMonitorDumpToFd(qemuMonitorPtr mon,
/* We don't have qemuMonitorTextDump(), so we should check mon->json
* here.
*/
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("dump-guest-memory is not supported in text mode"));
return -1;
}
@ -2108,7 +2108,7 @@ int qemuMonitorAddUSBDisk(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p path=%s", mon, path);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2129,7 +2129,7 @@ int qemuMonitorAddUSBDeviceExact(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p bus=%d dev=%d", mon, bus, dev);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2150,7 +2150,7 @@ int qemuMonitorAddUSBDeviceMatch(qemuMonitorPtr mon,
mon, vendor, product);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2173,7 +2173,7 @@ int qemuMonitorAddPCIHostDevice(qemuMonitorPtr mon,
hostAddr->domain, hostAddr->bus, hostAddr->slot, hostAddr->function);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2196,7 +2196,7 @@ int qemuMonitorAddPCIDisk(qemuMonitorPtr mon,
mon, path, bus);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2217,7 +2217,7 @@ int qemuMonitorAddPCINetwork(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p nicstr=%s", mon, nicstr);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2239,7 +2239,7 @@ int qemuMonitorRemovePCIDevice(qemuMonitorPtr mon,
guestAddr->slot, guestAddr->function);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2261,19 +2261,19 @@ int qemuMonitorSendFileHandle(qemuMonitorPtr mon,
mon, fdname, fd);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
if (fd < 0) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("fd must be valid"));
return -1;
}
if (!mon->hasSendFD) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("qemu is not using a unix socket monitor, "
"cannot send fd %s"), fdname);
return -1;
@ -2299,7 +2299,7 @@ int qemuMonitorCloseFileHandle(qemuMonitorPtr mon,
error = virSaveLastError();
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
goto cleanup;
}
@ -2330,7 +2330,7 @@ int qemuMonitorAddHostNetwork(qemuMonitorPtr mon,
vhostfd, NULLSTR(vhostfd_name));
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2369,7 +2369,7 @@ int qemuMonitorRemoveHostNetwork(qemuMonitorPtr mon,
mon, netname);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2394,7 +2394,7 @@ int qemuMonitorAddNetdev(qemuMonitorPtr mon,
vhostfd, NULLSTR(vhostfd_name));
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2431,7 +2431,7 @@ int qemuMonitorRemoveNetdev(qemuMonitorPtr mon,
mon, alias);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2452,7 +2452,7 @@ int qemuMonitorGetPtyPaths(qemuMonitorPtr mon,
mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2473,7 +2473,7 @@ int qemuMonitorAttachPCIDiskController(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2499,7 +2499,7 @@ int qemuMonitorAttachDrive(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2519,7 +2519,7 @@ int qemuMonitorGetAllPCIAddresses(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2538,7 +2538,7 @@ int qemuMonitorDriveDel(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2557,7 +2557,7 @@ int qemuMonitorDelDevice(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2580,7 +2580,7 @@ int qemuMonitorAddDeviceWithFd(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2614,7 +2614,7 @@ int qemuMonitorAddDrive(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2635,7 +2635,7 @@ int qemuMonitorSetDrivePassphrase(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2654,7 +2654,7 @@ int qemuMonitorCreateSnapshot(qemuMonitorPtr mon, const char *name)
VIR_DEBUG("mon=%p, name=%s",mon,name);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2673,7 +2673,7 @@ int qemuMonitorLoadSnapshot(qemuMonitorPtr mon, const char *name)
VIR_DEBUG("mon=%p, name=%s",mon,name);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2692,7 +2692,7 @@ int qemuMonitorDeleteSnapshot(qemuMonitorPtr mon, const char *name)
VIR_DEBUG("mon=%p, name=%s",mon,name);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2718,7 +2718,7 @@ qemuMonitorDiskSnapshot(qemuMonitorPtr mon, virJSONValuePtr actions,
mon, actions, device, file, format, reuse);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2728,7 +2728,7 @@ qemuMonitorDiskSnapshot(qemuMonitorPtr mon, virJSONValuePtr actions,
reuse);
} else {
if (actions || STRNEQ(format, "qcow2") || reuse) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("text monitor lacks several snapshot features"));
return -1;
}
@ -2748,7 +2748,7 @@ qemuMonitorTransaction(qemuMonitorPtr mon, virJSONValuePtr actions)
if (mon->json)
ret = qemuMonitorJSONTransaction(mon, actions);
else
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("transaction requires JSON monitor"));
return ret;
}
@ -2808,7 +2808,7 @@ int qemuMonitorScreendump(qemuMonitorPtr mon,
VIR_DEBUG("mon=%p, file=%s", mon, file);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG,"%s",
virReportError(VIR_ERR_INVALID_ARG,"%s",
_("monitor must not be NULL"));
return -1;
}
@ -2839,7 +2839,7 @@ int qemuMonitorBlockJob(qemuMonitorPtr mon,
/* Convert bandwidth MiB to bytes */
speed = bandwidth;
if (speed > ULLONG_MAX / 1024 / 1024) {
qemuReportError(VIR_ERR_OVERFLOW,
virReportError(VIR_ERR_OVERFLOW,
_("bandwidth must be less than %llu"),
ULLONG_MAX / 1024 / 1024);
return -1;
@ -2850,7 +2850,7 @@ int qemuMonitorBlockJob(qemuMonitorPtr mon,
ret = qemuMonitorJSONBlockJob(mon, device, base, speed, info, mode,
modern);
else
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("block jobs require JSON monitor"));
return ret;
}
@ -2950,7 +2950,7 @@ int qemuMonitorOpenGraphics(qemuMonitorPtr mon,
int ret;
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
@ -2976,13 +2976,13 @@ int qemuMonitorSystemWakeup(qemuMonitorPtr mon)
VIR_DEBUG("mon=%p", mon);
if (!mon) {
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("monitor must not be NULL"));
return -1;
}
if (!mon->json) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("JSON monitor is required"));
return -1;
}

View File

@ -147,7 +147,7 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
goto cleanup;
if (obj->type != VIR_JSON_TYPE_OBJECT) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Parsed JSON reply '%s' isn't an object"), line);
goto cleanup;
}
@ -168,11 +168,11 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
obj = NULL;
ret = 0;
} else {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unexpected JSON reply '%s'"), line);
}
} else {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown JSON reply '%s'"), line);
}
@ -237,7 +237,7 @@ qemuMonitorJSONCommandWithFd(qemuMonitorPtr mon,
if (!(id = qemuMonitorNextCommandID(mon)))
goto cleanup;
if (virJSONValueObjectAppendString(cmd, "id", id) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to append command 'id' string"));
goto cleanup;
}
@ -264,7 +264,7 @@ qemuMonitorJSONCommandWithFd(qemuMonitorPtr mon,
if (ret == 0) {
if (!msg.rxObject) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing monitor reply object"));
ret = -1;
} else {
@ -337,11 +337,11 @@ qemuMonitorJSONCheckError(virJSONValuePtr cmd,
/* Only send the user the command name + friendly error */
if (!error)
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to execute QEMU command '%s'"),
qemuMonitorJSONCommandName(cmd));
else
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to execute QEMU command '%s': %s"),
qemuMonitorJSONCommandName(cmd),
qemuMonitorJSONStringifyError(error));
@ -355,7 +355,7 @@ qemuMonitorJSONCheckError(virJSONValuePtr cmd,
VIR_DEBUG("Neither 'return' nor 'error' is set in the JSON reply %s: %s",
cmdstr, replystr);
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to execute QEMU command '%s'"),
qemuMonitorJSONCommandName(cmd));
VIR_FREE(cmdstr);
@ -415,7 +415,7 @@ qemuMonitorJSONMakeCommandRaw(bool wrap, const char *cmdname, ...)
char type;
if (strlen(key) < 3) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("argument key '%s' is too short, missing type prefix"),
key);
goto error;
@ -434,7 +434,7 @@ qemuMonitorJSONMakeCommandRaw(bool wrap, const char *cmdname, ...)
case 's': {
char *val = va_arg(args, char *);
if (!val) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("argument key '%s' must not have null value"),
key);
goto error;
@ -478,7 +478,7 @@ qemuMonitorJSONMakeCommandRaw(bool wrap, const char *cmdname, ...)
ret = virJSONValueObjectAppend(jargs, key, val);
} break;
default:
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unsupported data type '%c' for arg '%s'"), type, key - 2);
goto error;
}
@ -538,7 +538,7 @@ qemuMonitorJSONKeywordStringToJSON(const char *str, const char *firstkeyword)
for (i = 0 ; i < nkeywords ; i++) {
if (values[i] == NULL) {
if (i != 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected empty keyword in %s"), str);
goto error;
} else {
@ -912,7 +912,7 @@ qemuMonitorJSONHumanCommandWithFd(qemuMonitorPtr mon,
goto cleanup;
if (!(obj = virJSONValueObjectGet(reply, "return"))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("human monitor command was missing return data"));
goto cleanup;
}
@ -1153,13 +1153,13 @@ qemuMonitorJSONGetStatus(qemuMonitorPtr mon,
ret = -1;
if (!(data = virJSONValueObjectGet(reply, "return"))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("query-status reply was missing return data"));
goto cleanup;
}
if (virJSONValueObjectGetBoolean(data, "running", running) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("query-status reply was missing running state"));
goto cleanup;
}
@ -1256,19 +1256,19 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr reply,
int ncpus;
if (!(data = virJSONValueObjectGet(reply, "return"))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cpu reply was missing return data"));
goto cleanup;
}
if (data->type != VIR_JSON_TYPE_ARRAY) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cpu information was not an array"));
goto cleanup;
}
if ((ncpus = virJSONValueArraySize(data)) <= 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cpu information was empty"));
goto cleanup;
}
@ -1283,13 +1283,13 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr reply,
int cpu;
int thread;
if (!entry) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("character device information was missing array element"));
goto cleanup;
}
if (virJSONValueObjectGetNumberInt(entry, "CPU", &cpu) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cpu information was missing cpu number"));
goto cleanup;
}
@ -1302,7 +1302,7 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr reply,
}
if (cpu != i) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected cpu index %d expecting %d"),
i, cpu);
goto cleanup;
@ -1371,14 +1371,14 @@ int qemuMonitorJSONGetVirtType(qemuMonitorPtr mon,
bool val = false;
if (!(data = virJSONValueObjectGet(reply, "return"))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("info kvm reply was missing return data"));
ret = -1;
goto cleanup;
}
if (virJSONValueObjectGetBoolean(data, "enabled", &val) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("info kvm reply missing 'running' field"));
ret = -1;
goto cleanup;
@ -1428,14 +1428,14 @@ int qemuMonitorJSONGetBalloonInfo(qemuMonitorPtr mon,
unsigned long long mem;
if (!(data = virJSONValueObjectGet(reply, "return"))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("info balloon reply was missing return data"));
ret = -1;
goto cleanup;
}
if (virJSONValueObjectGetNumberUlong(data, "actual", &mem) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("info balloon reply was missing balloon data"));
ret = -1;
goto cleanup;
@ -1483,7 +1483,7 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon,
unsigned long long mem;
if (!(data = virJSONValueObjectGet(reply, "return"))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("info balloon reply was missing return data"));
ret = -1;
goto cleanup;
@ -1491,7 +1491,7 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon,
if (virJSONValueObjectHasKey(data, "actual") && (got < nr_stats)) {
if (virJSONValueObjectGetNumberUlong(data, "actual", &mem) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("info balloon reply was missing balloon actual"));
ret = -1;
goto cleanup;
@ -1503,7 +1503,7 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon,
if (virJSONValueObjectHasKey(data, "mem_swapped_in") && (got < nr_stats)) {
if (virJSONValueObjectGetNumberUlong(data, "mem_swapped_in", &mem) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("info balloon reply was missing balloon mem_swapped_in"));
ret = -1;
goto cleanup;
@ -1514,7 +1514,7 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon,
}
if (virJSONValueObjectHasKey(data, "mem_swapped_out") && (got < nr_stats)) {
if (virJSONValueObjectGetNumberUlong(data, "mem_swapped_out", &mem) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("info balloon reply was missing balloon mem_swapped_out"));
ret = -1;
goto cleanup;
@ -1525,7 +1525,7 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon,
}
if (virJSONValueObjectHasKey(data, "major_page_faults") && (got < nr_stats)) {
if (virJSONValueObjectGetNumberUlong(data, "major_page_faults", &mem) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("info balloon reply was missing balloon major_page_faults"));
ret = -1;
goto cleanup;
@ -1536,7 +1536,7 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon,
}
if (virJSONValueObjectHasKey(data, "minor_page_faults") && (got < nr_stats)) {
if (virJSONValueObjectGetNumberUlong(data, "minor_page_faults", &mem) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("info balloon reply was missing balloon minor_page_faults"));
ret = -1;
goto cleanup;
@ -1547,7 +1547,7 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon,
}
if (virJSONValueObjectHasKey(data, "free_mem") && (got < nr_stats)) {
if (virJSONValueObjectGetNumberUlong(data, "free_mem", &mem) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("info balloon reply was missing balloon free_mem"));
ret = -1;
goto cleanup;
@ -1558,7 +1558,7 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon,
}
if (virJSONValueObjectHasKey(data, "total_mem") && (got < nr_stats)) {
if (virJSONValueObjectGetNumberUlong(data, "total_mem", &mem) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("info balloon reply was missing balloon total_mem"));
ret = -1;
goto cleanup;
@ -1604,7 +1604,7 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon,
devices = virJSONValueObjectGet(reply, "return");
if (!devices || devices->type != VIR_JSON_TYPE_ARRAY) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("block info reply was missing device list"));
goto cleanup;
}
@ -1616,13 +1616,13 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon,
const char *status;
if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("block info device entry was not in expected format"));
goto cleanup;
}
if ((thisdev = virJSONValueObjectGetString(dev, "device")) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("block info device entry was not in expected format"));
goto cleanup;
}
@ -1641,14 +1641,14 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon,
}
if (virJSONValueObjectGetBoolean(dev, "removable", &info->removable) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot read %s value"),
"removable");
goto cleanup;
}
if (virJSONValueObjectGetBoolean(dev, "locked", &info->locked) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot read %s value"),
"locked");
goto cleanup;
@ -1722,7 +1722,7 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
devices = virJSONValueObjectGet(reply, "return");
if (!devices || devices->type != VIR_JSON_TYPE_ARRAY) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats reply was missing device list"));
goto cleanup;
}
@ -1732,13 +1732,13 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
virJSONValuePtr stats;
const char *thisdev;
if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats device entry was not in expected format"));
goto cleanup;
}
if ((thisdev = virJSONValueObjectGetString(dev, "device")) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats device entry was not in expected format"));
goto cleanup;
}
@ -1756,19 +1756,19 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
found = 1;
if ((stats = virJSONValueObjectGet(dev, "stats")) == NULL ||
stats->type != VIR_JSON_TYPE_OBJECT) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats stats entry was not in expected format"));
goto cleanup;
}
if (virJSONValueObjectGetNumberLong(stats, "rd_bytes", rd_bytes) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot read %s statistic"),
"rd_bytes");
goto cleanup;
}
if (virJSONValueObjectGetNumberLong(stats, "rd_operations", rd_req) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot read %s statistic"),
"rd_operations");
goto cleanup;
@ -1777,19 +1777,19 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
virJSONValueObjectHasKey(stats, "rd_total_time_ns") &&
(virJSONValueObjectGetNumberLong(stats, "rd_total_time_ns",
rd_total_times) < 0)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot read %s statistic"),
"rd_total_time_ns");
goto cleanup;
}
if (virJSONValueObjectGetNumberLong(stats, "wr_bytes", wr_bytes) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot read %s statistic"),
"wr_bytes");
goto cleanup;
}
if (virJSONValueObjectGetNumberLong(stats, "wr_operations", wr_req) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot read %s statistic"),
"wr_operations");
goto cleanup;
@ -1798,7 +1798,7 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
virJSONValueObjectHasKey(stats, "wr_total_time_ns") &&
(virJSONValueObjectGetNumberLong(stats, "wr_total_time_ns",
wr_total_times) < 0)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot read %s statistic"),
"wr_total_time_ns");
goto cleanup;
@ -1807,7 +1807,7 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
virJSONValueObjectHasKey(stats, "flush_operations") &&
(virJSONValueObjectGetNumberLong(stats, "flush_operations",
flush_req) < 0)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot read %s statistic"),
"flush_operations");
goto cleanup;
@ -1816,7 +1816,7 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
virJSONValueObjectHasKey(stats, "flush_total_time_ns") &&
(virJSONValueObjectGetNumberLong(stats, "flush_total_time_ns",
flush_total_times) < 0)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot read %s statistic"),
"flush_total_time_ns");
goto cleanup;
@ -1824,7 +1824,7 @@ int qemuMonitorJSONGetBlockStatsInfo(qemuMonitorPtr mon,
}
if (!found) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find statistics for device '%s'"), dev_name);
goto cleanup;
}
@ -1861,7 +1861,7 @@ int qemuMonitorJSONGetBlockStatsParamsNumber(qemuMonitorPtr mon,
devices = virJSONValueObjectGet(reply, "return");
if (!devices || devices->type != VIR_JSON_TYPE_ARRAY) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats reply was missing device list"));
goto cleanup;
}
@ -1869,14 +1869,14 @@ int qemuMonitorJSONGetBlockStatsParamsNumber(qemuMonitorPtr mon,
dev = virJSONValueArrayGet(devices, 0);
if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats device entry was not in expected format"));
goto cleanup;
}
if ((stats = virJSONValueObjectGet(dev, "stats")) == NULL ||
stats->type != VIR_JSON_TYPE_OBJECT) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats stats entry was not in expected format"));
goto cleanup;
}
@ -1936,7 +1936,7 @@ int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon,
devices = virJSONValueObjectGet(reply, "return");
if (!devices || devices->type != VIR_JSON_TYPE_ARRAY) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats reply was missing device list"));
goto cleanup;
}
@ -1947,13 +1947,13 @@ int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon,
virJSONValuePtr parent;
const char *thisdev;
if (!dev || dev->type != VIR_JSON_TYPE_OBJECT) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats device entry was not in expected format"));
goto cleanup;
}
if ((thisdev = virJSONValueObjectGetString(dev, "device")) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats device entry was not in expected format"));
goto cleanup;
}
@ -1971,20 +1971,20 @@ int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon,
found = 1;
if ((parent = virJSONValueObjectGet(dev, "parent")) == NULL ||
parent->type != VIR_JSON_TYPE_OBJECT) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats parent entry was not in expected format"));
goto cleanup;
}
if ((stats = virJSONValueObjectGet(parent, "stats")) == NULL ||
stats->type != VIR_JSON_TYPE_OBJECT) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("blockstats stats entry was not in expected format"));
goto cleanup;
}
if (virJSONValueObjectGetNumberUlong(stats, "wr_highest_offset", extent) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot read %s statistic"),
"wr_highest_offset");
goto cleanup;
@ -1992,7 +1992,7 @@ int qemuMonitorJSONGetBlockExtent(qemuMonitorPtr mon,
}
if (!found) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find statistics for device '%s'"), dev_name);
goto cleanup;
}
@ -2373,19 +2373,19 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply,
unsigned long long t;
if (!(ret = virJSONValueObjectGet(reply, "return"))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("info migration reply was missing return data"));
return -1;
}
if (!(statusstr = virJSONValueObjectGetString(ret, "status"))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("info migration reply was missing return status"));
return -1;
}
if ((*status = qemuMonitorMigrationStatusTypeFromString(statusstr)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected migration status in %s"), statusstr);
return -1;
}
@ -2393,26 +2393,26 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply,
if (*status == QEMU_MONITOR_MIGRATION_STATUS_ACTIVE) {
virJSONValuePtr ram = virJSONValueObjectGet(ret, "ram");
if (!ram) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("migration was active, but no RAM info was set"));
return -1;
}
if (virJSONValueObjectGetNumberUlong(ram, "transferred",
transferred) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("migration was active, but RAM 'transferred' "
"data was missing"));
return -1;
}
if (virJSONValueObjectGetNumberUlong(ram, "remaining", remaining) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("migration was active, but RAM 'remaining' "
"data was missing"));
return -1;
}
if (virJSONValueObjectGetNumberUlong(ram, "total", total) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("migration was active, but RAM 'total' "
"data was missing"));
return -1;
@ -2424,21 +2424,21 @@ qemuMonitorJSONGetMigrationStatusReply(virJSONValuePtr reply,
}
if (virJSONValueObjectGetNumberUlong(disk, "transferred", &t) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("disk migration was active, but 'transferred' "
"data was missing"));
return -1;
}
*transferred += t;
if (virJSONValueObjectGetNumberUlong(disk, "remaining", &t) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("disk migration was active, but 'remaining' "
"data was missing"));
return -1;
}
*remaining += t;
if (virJSONValueObjectGetNumberUlong(disk, "total", &t) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("disk migration was active, but 'total' "
"data was missing"));
return -1;
@ -2601,7 +2601,7 @@ int qemuMonitorJSONGraphicsRelocate(qemuMonitorPtr mon,
int qemuMonitorJSONAddUSBDisk(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
const char *path ATTRIBUTE_UNUSED)
{
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("usb_add not supported in JSON mode"));
return -1;
}
@ -2611,7 +2611,7 @@ int qemuMonitorJSONAddUSBDeviceExact(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
int bus ATTRIBUTE_UNUSED,
int dev ATTRIBUTE_UNUSED)
{
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("usb_add not supported in JSON mode"));
return -1;
}
@ -2621,7 +2621,7 @@ int qemuMonitorJSONAddUSBDeviceMatch(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
int vendor ATTRIBUTE_UNUSED,
int product ATTRIBUTE_UNUSED)
{
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("usb_add not supported in JSON mode"));
return -1;
}
@ -2631,7 +2631,7 @@ int qemuMonitorJSONAddPCIHostDevice(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainDevicePCIAddress *hostAddr ATTRIBUTE_UNUSED,
virDomainDevicePCIAddress *guestAddr ATTRIBUTE_UNUSED)
{
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("pci_add not supported in JSON mode"));
return -1;
}
@ -2642,7 +2642,7 @@ int qemuMonitorJSONAddPCIDisk(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
const char *bus ATTRIBUTE_UNUSED,
virDomainDevicePCIAddress *guestAddr ATTRIBUTE_UNUSED)
{
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("pci_add not supported in JSON mode"));
return -1;
}
@ -2652,7 +2652,7 @@ int qemuMonitorJSONAddPCINetwork(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
const char *nicstr ATTRIBUTE_UNUSED,
virDomainDevicePCIAddress *guestAddr ATTRIBUTE_UNUSED)
{
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("pci_add not supported in JSON mode"));
return -1;
}
@ -2661,7 +2661,7 @@ int qemuMonitorJSONAddPCINetwork(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
int qemuMonitorJSONRemovePCIDevice(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainDevicePCIAddress *guestAddr ATTRIBUTE_UNUSED)
{
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("pci_del not supported in JSON mode"));
return -1;
}
@ -2833,13 +2833,13 @@ static int qemuMonitorJSONExtractPtyPaths(virJSONValuePtr reply,
int i;
if (!(data = virJSONValueObjectGet(reply, "return"))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("character device reply was missing return data"));
goto cleanup;
}
if (data->type != VIR_JSON_TYPE_ARRAY) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("character device information was not an array"));
goto cleanup;
}
@ -2849,19 +2849,19 @@ static int qemuMonitorJSONExtractPtyPaths(virJSONValuePtr reply,
const char *type;
const char *id;
if (!entry) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("character device information was missing array element"));
goto cleanup;
}
if (!(type = virJSONValueObjectGetString(entry, "filename"))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("character device information was missing filename"));
goto cleanup;
}
if (!(id = virJSONValueObjectGetString(entry, "label"))) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("character device information was missing filename"));
goto cleanup;
}
@ -2874,7 +2874,7 @@ static int qemuMonitorJSONExtractPtyPaths(virJSONValuePtr reply,
}
if (virHashAddEntry(paths, id, path) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to save chardev path '%s'"), path);
VIR_FREE(path);
goto cleanup;
@ -2918,7 +2918,7 @@ int qemuMonitorJSONAttachPCIDiskController(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
const char *bus ATTRIBUTE_UNUSED,
virDomainDevicePCIAddress *guestAddr ATTRIBUTE_UNUSED)
{
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("pci_add not supported in JSON mode"));
return -1;
}
@ -2932,19 +2932,19 @@ qemuMonitorJSONGetGuestDriveAddress(virJSONValuePtr reply,
addr = virJSONValueObjectGet(reply, "return");
if (!addr || addr->type != VIR_JSON_TYPE_OBJECT) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("drive_add reply was missing device address"));
return -1;
}
if (virJSONValueObjectGetNumberUint(addr, "bus", &driveAddr->bus) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("drive_add reply was missing device bus number"));
return -1;
}
if (virJSONValueObjectGetNumberUint(addr, "unit", &driveAddr->unit) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("drive_add reply was missing device unit number"));
return -1;
}
@ -2995,7 +2995,7 @@ int qemuMonitorJSONAttachDrive(qemuMonitorPtr mon,
int qemuMonitorJSONGetAllPCIAddresses(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
qemuMonitorPCIAddress **addrs ATTRIBUTE_UNUSED)
{
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("query-pci not supported in JSON mode"));
return -1;
}
@ -3341,7 +3341,7 @@ int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon,
if (hmp) {
if (!qemuMonitorCheckHMP(mon, NULL)) {
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("HMP passthrough is not supported by qemu"
" process; only QMP commands can be used"));
return -1;
@ -3441,7 +3441,7 @@ static int qemuMonitorJSONGetBlockJobInfoOne(virJSONValuePtr entry,
unsigned long long speed_bytes;
if ((this_dev = virJSONValueObjectGetString(entry, "device")) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("entry was missing 'device'"));
return -1;
}
@ -3450,7 +3450,7 @@ static int qemuMonitorJSONGetBlockJobInfoOne(virJSONValuePtr entry,
type = virJSONValueObjectGetString(entry, "type");
if (!type) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("entry was missing 'type'"));
return -1;
}
@ -3460,20 +3460,20 @@ static int qemuMonitorJSONGetBlockJobInfoOne(virJSONValuePtr entry,
info->type = VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN;
if (virJSONValueObjectGetNumberUlong(entry, "speed", &speed_bytes) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("entry was missing 'speed'"));
return -1;
}
info->bandwidth = speed_bytes / 1024ULL / 1024ULL;
if (virJSONValueObjectGetNumberUlong(entry, "offset", &info->cur) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("entry was missing 'offset'"));
return -1;
}
if (virJSONValueObjectGetNumberUlong(entry, "len", &info->end) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("entry was missing 'len'"));
return -1;
}
@ -3495,19 +3495,19 @@ static int qemuMonitorJSONGetBlockJobInfo(virJSONValuePtr reply,
return -1;
if ((data = virJSONValueObjectGet(reply, "return")) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("reply was missing return data"));
return -1;
}
if (data->type != VIR_JSON_TYPE_ARRAY) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("unrecognized format of block job information"));
return -1;
}
if ((nr_results = virJSONValueArraySize(data)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("unable to determine array size"));
return -1;
}
@ -3515,7 +3515,7 @@ static int qemuMonitorJSONGetBlockJobInfo(virJSONValuePtr reply,
for (i = 0; i < nr_results; i++) {
virJSONValuePtr entry = virJSONValueArrayGet(data, i);
if (!entry) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing array element"));
return -1;
}
@ -3543,12 +3543,12 @@ qemuMonitorJSONBlockJob(qemuMonitorPtr mon,
const char *cmd_name = NULL;
if (base && (mode != BLOCK_JOB_PULL || !modern)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("only modern block pull supports base: %s"), base);
return -1;
}
if (speed && mode == BLOCK_JOB_PULL && !modern) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("only modern block pull supports speed: %llu"),
speed);
return -1;
@ -3593,21 +3593,21 @@ qemuMonitorJSONBlockJob(qemuMonitorPtr mon,
if (ret == 0 && virJSONValueObjectHasKey(reply, "error")) {
ret = -1;
if (qemuMonitorJSONHasError(reply, "DeviceNotActive")) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("No active operation on device: %s"),
device);
} else if (qemuMonitorJSONHasError(reply, "DeviceInUse")){
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("Device %s in use"), device);
} else if (qemuMonitorJSONHasError(reply, "NotSupported")) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("Operation is not supported for device: %s"),
device);
} else if (qemuMonitorJSONHasError(reply, "CommandNotFound")) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("Command '%s' is not found"), cmd_name);
} else {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unexpected error"));
}
}
@ -3661,7 +3661,7 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr result,
io_throttle = virJSONValueObjectGet(result, "return");
if (!io_throttle || io_throttle->type != VIR_JSON_TYPE_ARRAY) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_(" block_io_throttle reply was missing device list"));
goto cleanup;
}
@ -3672,13 +3672,13 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr result,
const char *current_dev;
if (!temp_dev || temp_dev->type != VIR_JSON_TYPE_OBJECT) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("block_io_throttle device entry was not in expected format"));
goto cleanup;
}
if ((current_dev = virJSONValueObjectGetString(temp_dev, "device")) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("block_io_throttle device entry was not in expected format"));
goto cleanup;
}
@ -3692,43 +3692,43 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr result,
found = 1;
if ((inserted = virJSONValueObjectGet(temp_dev, "inserted")) == NULL ||
inserted->type != VIR_JSON_TYPE_OBJECT) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("block_io_throttle inserted entry was not in expected format"));
goto cleanup;
}
if (virJSONValueObjectGetNumberUlong(inserted, "bps", &reply->total_bytes_sec) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot read total_bytes_sec"));
goto cleanup;
}
if (virJSONValueObjectGetNumberUlong(inserted, "bps_rd", &reply->read_bytes_sec) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot read read_bytes_sec"));
goto cleanup;
}
if (virJSONValueObjectGetNumberUlong(inserted, "bps_wr", &reply->write_bytes_sec) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot read write_bytes_sec"));
goto cleanup;
}
if (virJSONValueObjectGetNumberUlong(inserted, "iops", &reply->total_iops_sec) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot read total_iops_sec"));
goto cleanup;
}
if (virJSONValueObjectGetNumberUlong(inserted, "iops_rd", &reply->read_iops_sec) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot read read_iops_sec"));
goto cleanup;
}
if (virJSONValueObjectGetNumberUlong(inserted, "iops_wr", &reply->write_iops_sec) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cannot read write_iops_sec"));
goto cleanup;
}
@ -3736,7 +3736,7 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr result,
}
if (!found) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find throttling info for device '%s'"),
device);
goto cleanup;
@ -3771,13 +3771,13 @@ int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPtr mon,
if (ret == 0 && virJSONValueObjectHasKey(result, "error")) {
if (qemuMonitorJSONHasError(result, "DeviceNotActive"))
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("No active operation on device: %s"), device);
else if (qemuMonitorJSONHasError(result, "NotSupported"))
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("Operation is not supported for device: %s"), device);
else
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unexpected error"));
ret = -1;
}
@ -3804,13 +3804,13 @@ int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPtr mon,
if (ret == 0 && virJSONValueObjectHasKey(result, "error")) {
if (qemuMonitorJSONHasError(result, "DeviceNotActive"))
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("No active operation on device: %s"), device);
else if (qemuMonitorJSONHasError(result, "NotSupported"))
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("Operation is not supported for device: %s"), device);
else
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unexpected error"));
ret = -1;
}

View File

@ -173,7 +173,7 @@ int qemuMonitorTextIOProcess(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
/* Handled, so skip forward over password prompt */
start = passwd;
} else {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Password request seen, but no handler available"));
return -1;
}
@ -321,7 +321,7 @@ qemuMonitorSendDiskPassphrase(qemuMonitorPtr mon,
pathStart = strstr(data, DISK_ENCRYPTION_PREFIX);
pathEnd = strstr(data, DISK_ENCRYPTION_POSTFIX);
if (!pathStart || !pathEnd || pathStart >= pathEnd) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unable to extract disk path from %s"),
data);
return -1;
@ -389,7 +389,7 @@ qemuMonitorTextStopCPUs(qemuMonitorPtr mon) {
char *info;
if (qemuMonitorHMPCommand(mon, "stop", &info) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("cannot stop CPU execution"));
return -1;
}
@ -410,7 +410,7 @@ qemuMonitorTextGetStatus(qemuMonitorPtr mon,
*reason = VIR_DOMAIN_PAUSED_UNKNOWN;
if (qemuMonitorHMPCommand(mon, "info status", &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("cannot get status info"));
return -1;
}
@ -433,7 +433,7 @@ qemuMonitorTextGetStatus(qemuMonitorPtr mon,
*reason = qemuMonitorVMStatusToPausedReason(status);
*running = false;
} else {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("unexpected reply from info status: %s"), reply);
goto cleanup;
}
@ -450,7 +450,7 @@ int qemuMonitorTextSystemPowerdown(qemuMonitorPtr mon) {
char *info;
if (qemuMonitorHMPCommand(mon, "system_powerdown", &info) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("system shutdown operation failed"));
return -1;
}
@ -474,14 +474,14 @@ int qemuMonitorTextSetLink(qemuMonitorPtr mon, const char *name, enum virDomainN
goto error;
}
if (qemuMonitorHMPCommand(mon, cmd, &info) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("set_link operation failed"));
goto error;
}
/* check if set_link command is supported */
if (strstr(info, "\nunknown ")) {
qemuReportError(VIR_ERR_NO_SUPPORT,
virReportError(VIR_ERR_NO_SUPPORT,
"%s",
_("\'set_link\' not supported by this qemu"));
goto error;
@ -489,7 +489,7 @@ int qemuMonitorTextSetLink(qemuMonitorPtr mon, const char *name, enum virDomainN
/* check if qemu didn't reject device name */
if (strstr(info, "\nDevice ")) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("device name rejected"));
goto error;
}
@ -509,7 +509,7 @@ int qemuMonitorTextSystemReset(qemuMonitorPtr mon) {
char *info;
if (qemuMonitorHMPCommand(mon, "system_reset", &info) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("system reset operation failed"));
return -1;
}
@ -528,7 +528,7 @@ int qemuMonitorTextGetCPUInfo(qemuMonitorPtr mon,
size_t ncpupids = 0;
if (qemuMonitorHMPCommand(mon, "info cpus", &qemucpus) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("cannot run monitor command to fetch CPU thread info"));
return -1;
}
@ -609,7 +609,7 @@ int qemuMonitorTextGetVirtType(qemuMonitorPtr mon,
*virtType = VIR_DOMAIN_VIRT_QEMU;
if (qemuMonitorHMPCommand(mon, "info kvm", &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("could not query kvm status"));
return -1;
}
@ -716,7 +716,7 @@ int qemuMonitorTextGetBalloonInfo(qemuMonitorPtr mon,
char *offset;
if (qemuMonitorHMPCommand(mon, "info balloon", &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("could not query memory balloon allocation"));
return -1;
}
@ -726,13 +726,13 @@ int qemuMonitorTextGetBalloonInfo(qemuMonitorPtr mon,
struct _virDomainMemoryStat stats[1];
if (qemuMonitorParseBalloonInfo(offset, stats, 1) == 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected balloon information '%s'"), reply);
goto cleanup;
}
if (stats[0].tag != VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected balloon information '%s'"), reply);
goto cleanup;
}
@ -760,7 +760,7 @@ int qemuMonitorTextGetMemoryStats(qemuMonitorPtr mon,
char *offset;
if (qemuMonitorHMPCommand(mon, "info balloon", &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("could not query memory balloon statistics"));
return -1;
}
@ -787,13 +787,13 @@ int qemuMonitorTextGetBlockInfo(qemuMonitorPtr mon,
int tmp;
if (qemuMonitorHMPCommand(mon, "info block", &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("info block command failed"));
goto cleanup;
}
if (strstr(reply, "\ninfo ")) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
"%s",
_("info block not supported by this qemu"));
goto cleanup;
@ -906,7 +906,7 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
int devnamelen = strlen(dev_name);
if (qemuMonitorHMPCommand (mon, "info blockstats", &info) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("'info blockstats' command failed"));
goto cleanup;
}
@ -917,7 +917,7 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
* to detect if qemu supports the command.
*/
if (strstr(info, "\ninfo ")) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
"%s",
_("'info blockstats' not supported by this qemu"));
goto cleanup;
@ -1016,7 +1016,7 @@ int qemuMonitorTextGetBlockStatsInfo(qemuMonitorPtr mon,
}
/* If we reach here then the device was not found. */
qemuReportError (VIR_ERR_INVALID_ARG,
virReportError (VIR_ERR_INVALID_ARG,
_("no stats found for device %s"), dev_name);
cleanup:
@ -1033,7 +1033,7 @@ int qemuMonitorTextGetBlockStatsParamsNumber(qemuMonitorPtr mon,
const char *p, *eol;
if (qemuMonitorHMPCommand (mon, "info blockstats", &info) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("'info blockstats' command failed"));
goto cleanup;
}
@ -1044,7 +1044,7 @@ int qemuMonitorTextGetBlockStatsParamsNumber(qemuMonitorPtr mon,
* to detect if qemu supports the command.
*/
if (strstr(info, "\ninfo ")) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
"%s",
_("'info blockstats' not supported by this qemu"));
goto cleanup;
@ -1096,7 +1096,7 @@ int qemuMonitorTextGetBlockExtent(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
const char *dev_name ATTRIBUTE_UNUSED,
unsigned long long *extent ATTRIBUTE_UNUSED)
{
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("unable to query block extent with this QEMU"));
return -1;
}
@ -1117,7 +1117,7 @@ int qemuMonitorTextBlockResize(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("failed to resize block"));
goto cleanup;
}
@ -1173,7 +1173,7 @@ int qemuMonitorTextSetVNCPassword(qemuMonitorPtr mon,
qemuMonitorSendVNCPassphrase,
(char *)password,
-1, &info) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("setting VNC password failed"));
return -1;
}
@ -1198,7 +1198,7 @@ int qemuMonitorTextSetPassword(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("setting password failed"));
goto cleanup;
}
@ -1232,7 +1232,7 @@ int qemuMonitorTextExpirePassword(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("expiring password failed"));
goto cleanup;
}
@ -1271,7 +1271,7 @@ int qemuMonitorTextSetBalloon(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("could not balloon memory allocation"));
VIR_FREE(cmd);
return -1;
@ -1308,7 +1308,7 @@ int qemuMonitorTextSetCPU(qemuMonitorPtr mon, int cpu, int online)
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("could not change CPU online status"));
VIR_FREE(cmd);
return -1;
@ -1343,7 +1343,7 @@ int qemuMonitorTextEjectMedia(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("could not eject media on %s"), dev_name);
goto cleanup;
}
@ -1352,7 +1352,7 @@ int qemuMonitorTextEjectMedia(qemuMonitorPtr mon,
* device not found, device is locked ...
* No message is printed on success it seems */
if (c_strcasestr(reply, "device ")) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("could not eject media on %s: %s"), dev_name, reply);
goto cleanup;
}
@ -1387,7 +1387,7 @@ int qemuMonitorTextChangeMedia(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("could not change media on %s"), dev_name);
goto cleanup;
}
@ -1396,14 +1396,14 @@ int qemuMonitorTextChangeMedia(qemuMonitorPtr mon,
* device not found, device is locked ...
* No message is printed on success it seems */
if (c_strcasestr(reply, "device ")) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("could not change media on %s: %s"), dev_name, reply);
goto cleanup;
}
/* Could not open message indicates bad filename */
if (strstr(reply, "Could not open ")) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("could not change media on %s: %s"), dev_name, reply);
goto cleanup;
}
@ -1439,7 +1439,7 @@ static int qemuMonitorTextSaveMemory(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("could not save memory region to '%s'"), path);
goto cleanup;
}
@ -1486,7 +1486,7 @@ int qemuMonitorTextSetMigrationSpeed(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &info) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("could not restrict migration speed"));
goto cleanup;
}
@ -1513,7 +1513,7 @@ int qemuMonitorTextSetMigrationDowntime(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &info) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("could not set maximum migration downtime"));
goto cleanup;
}
@ -1554,7 +1554,7 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon,
*total = 0;
if (qemuMonitorHMPCommand(mon, "info migrate", &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("cannot query migration status"));
return -1;
}
@ -1563,14 +1563,14 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon,
tmp += strlen(MIGRATION_PREFIX);
end = strchr(tmp, '\r');
if (end == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected migration status in %s"), reply);
goto cleanup;
}
*end = '\0';
if ((*status = qemuMonitorMigrationStatusTypeFromString(tmp)) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected migration status in %s"), reply);
goto cleanup;
}
@ -1583,7 +1583,7 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon,
tmp += strlen(MIGRATION_TRANSFER_PREFIX);
if (virStrToLong_ull(tmp, &end, 10, transferred) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse migration data transferred "
"statistic %s"), tmp);
goto cleanup;
@ -1596,7 +1596,7 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon,
tmp += strlen(MIGRATION_REMAINING_PREFIX);
if (virStrToLong_ull(tmp, &end, 10, remaining) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse migration data remaining "
"statistic %s"), tmp);
goto cleanup;
@ -1609,7 +1609,7 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon,
tmp += strlen(MIGRATION_TOTAL_PREFIX);
if (virStrToLong_ull(tmp, &end, 10, total) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse migration data total "
"statistic %s"), tmp);
goto cleanup;
@ -1625,7 +1625,7 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon,
tmp += strlen(MIGRATION_DISK_TRANSFER_PREFIX);
if (virStrToLong_ull(tmp, &end, 10, &disk_transferred) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse disk migration data "
"transferred statistic %s"), tmp);
goto cleanup;
@ -1638,7 +1638,7 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon,
tmp += strlen(MIGRATION_DISK_REMAINING_PREFIX);
if (virStrToLong_ull(tmp, &end, 10, &disk_remaining) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse disk migration data remaining "
"statistic %s"), tmp);
goto cleanup;
@ -1651,7 +1651,7 @@ int qemuMonitorTextGetMigrationStatus(qemuMonitorPtr mon,
tmp += strlen(MIGRATION_DISK_TOTAL_PREFIX);
if (virStrToLong_ull(tmp, &end, 10, &disk_total) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot parse disk migration data total "
"statistic %s"), tmp);
goto cleanup;
@ -1705,21 +1705,21 @@ int qemuMonitorTextMigrate(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &info) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to start migration to %s"), dest);
goto cleanup;
}
/* Now check for "fail" in the output string */
if (strstr(info, "fail") != NULL) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("migration to '%s' failed: %s"), dest, info);
goto cleanup;
}
/* If the command isn't supported then qemu prints:
* unknown command: migrate" */
if (strstr(info, "unknown command:")) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("migration to '%s' not supported by this qemu: %s"), dest, info);
goto cleanup;
}
@ -1740,7 +1740,7 @@ int qemuMonitorTextMigrateCancel(qemuMonitorPtr mon)
char *info = NULL;
if (qemuMonitorHMPCommand(mon, "migrate_cancel", &info) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("cannot run monitor command to cancel migration"));
return -1;
}
@ -1769,7 +1769,7 @@ int qemuMonitorTextGraphicsRelocate(qemuMonitorPtr mon,
if (qemuMonitorHMPCommand(mon, cmd, &info) < 0) {
VIR_FREE(cmd);
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("cannot run monitor command to relocate graphics client"));
return -1;
}
@ -1800,7 +1800,7 @@ int qemuMonitorTextAddUSBDisk(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &info) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("cannot run monitor command to add usb disk"));
goto cleanup;
}
@ -1808,7 +1808,7 @@ int qemuMonitorTextAddUSBDisk(qemuMonitorPtr mon,
/* If the command failed qemu prints:
* Could not add ... */
if (strstr(info, "Could not add ")) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("unable to add USB disk %s: %s"), path, info);
goto cleanup;
}
@ -1836,7 +1836,7 @@ static int qemuMonitorTextAddUSBDevice(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("cannot attach usb device"));
goto cleanup;
}
@ -1844,7 +1844,7 @@ static int qemuMonitorTextAddUSBDevice(qemuMonitorPtr mon,
/* If the command failed qemu prints:
* Could not add ... */
if (strstr(reply, "Could not add ")) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("adding usb device failed"));
goto cleanup;
}
@ -1977,19 +1977,19 @@ int qemuMonitorTextAddPCIHostDevice(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("cannot attach host pci device"));
goto cleanup;
}
if (strstr(reply, "invalid type: host")) {
qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("PCI device assignment is not supported by this version of qemu"));
goto cleanup;
}
if (qemuMonitorTextParsePciAddReply(mon, reply, guestAddr) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("parsing pci_add reply failed: %s"), reply);
goto cleanup;
}
@ -2028,7 +2028,7 @@ try_command:
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("cannot attach %s disk %s"), bus, path);
goto cleanup;
}
@ -2041,7 +2041,7 @@ try_command:
goto try_command;
}
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("adding %s disk failed %s: %s"), bus, path, reply);
goto cleanup;
}
@ -2070,13 +2070,13 @@ int qemuMonitorTextAddPCINetwork(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to add NIC with '%s'"), cmd);
goto cleanup;
}
if (qemuMonitorTextParsePciAddReply(mon, reply, guestAddr) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("parsing pci_add reply failed: %s"), reply);
goto cleanup;
}
@ -2114,7 +2114,7 @@ try_command:
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("failed to remove PCI device"));
goto cleanup;
}
@ -2133,7 +2133,7 @@ try_command:
* nothing is printed on success */
if (strstr(reply, "invalid slot") ||
strstr(reply, "Invalid pci address")) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to detach PCI device, invalid address %.4x:%.2x:%.2x: %s"),
guestAddr->domain, guestAddr->bus, guestAddr->slot, reply);
goto cleanup;
@ -2162,7 +2162,7 @@ int qemuMonitorTextSendFileHandle(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommandWithFd(mon, cmd, fd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to pass fd to qemu with '%s'"), cmd);
goto cleanup;
}
@ -2170,14 +2170,14 @@ int qemuMonitorTextSendFileHandle(qemuMonitorPtr mon,
/* If the command isn't supported then qemu prints:
* unknown command: getfd" */
if (strstr(reply, "unknown command:")) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("qemu does not support sending of file handles: %s"),
reply);
goto cleanup;
}
if (STRNEQ(reply, "")) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to send file handle '%s': %s"),
fdname, reply);
goto cleanup;
@ -2205,7 +2205,7 @@ int qemuMonitorTextCloseFileHandle(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to close fd in qemu with '%s'"), cmd);
goto cleanup;
}
@ -2213,7 +2213,7 @@ int qemuMonitorTextCloseFileHandle(qemuMonitorPtr mon,
/* If the command isn't supported then qemu prints:
* unknown command: getfd" */
if (strstr(reply, "unknown command:")) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("qemu does not support closing of file handles: %s"),
reply);
goto cleanup;
@ -2241,13 +2241,13 @@ int qemuMonitorTextAddHostNetwork(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to add host net with '%s'"), cmd);
goto cleanup;
}
if (STRNEQ(reply, "")) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unable to add host net: %s"),
reply);
goto cleanup;
@ -2276,7 +2276,7 @@ int qemuMonitorTextRemoveHostNetwork(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to remove host network in qemu with '%s'"), cmd);
goto cleanup;
}
@ -2305,7 +2305,7 @@ int qemuMonitorTextAddNetdev(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to add netdev with '%s'"), cmd);
goto cleanup;
}
@ -2334,7 +2334,7 @@ int qemuMonitorTextRemoveNetdev(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to remove netdev in qemu with '%s'"), cmd);
goto cleanup;
}
@ -2369,7 +2369,7 @@ int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon,
int ret = -1;
if (qemuMonitorHMPCommand(mon, "info chardev", &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("failed to retrieve chardev info in qemu with 'info chardev'"));
return -1;
}
@ -2420,7 +2420,7 @@ int qemuMonitorTextGetPtyPaths(qemuMonitorPtr mon,
}
if (virHashAddEntry(paths, id, path) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to save chardev path '%s'"),
path);
VIR_FREE(path);
@ -2454,7 +2454,7 @@ try_command:
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("cannot attach %s disk controller"), bus);
goto cleanup;
}
@ -2467,7 +2467,7 @@ try_command:
goto try_command;
}
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("adding %s disk controller failed: %s"), bus, reply);
goto cleanup;
}
@ -2553,13 +2553,13 @@ try_command:
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to attach drive '%s'"), drivestr);
goto cleanup;
}
if (strstr(reply, "unknown command:")) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("drive hotplug is not supported"));
goto cleanup;
}
@ -2571,7 +2571,7 @@ try_command:
tryOldSyntax = 1;
goto try_command;
}
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("adding %s disk failed: %s"), drivestr, reply);
goto cleanup;
}
@ -2626,7 +2626,7 @@ cleanup:
(p) += strlen(lbl);
#define GET_INT(p, base, val) \
if (virStrToLong_ui((p), &(p), (base), &(val)) < 0) { \
qemuReportError(VIR_ERR_OPERATION_FAILED, \
virReportError(VIR_ERR_OPERATION_FAILED, \
_("cannot parse value for %s"), #val); \
break; \
}
@ -2644,7 +2644,7 @@ int qemuMonitorTextGetAllPCIAddresses(qemuMonitorPtr mon,
*retaddrs = NULL;
if (qemuMonitorHMPCommand(mon, "info pci", &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("cannot query PCI addresses"));
return -1;
}
@ -2737,13 +2737,13 @@ int qemuMonitorTextDelDevice(qemuMonitorPtr mon,
VIR_DEBUG("TextDelDevice devalias=%s", devalias);
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("cannot detach %s device"), devalias);
goto cleanup;
}
if (STRNEQ(reply, "")) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("detaching %s device failed: %s"), devalias, reply);
goto cleanup;
}
@ -2777,7 +2777,7 @@ int qemuMonitorTextAddDevice(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("cannot attach %s device"), devicestr);
goto cleanup;
}
@ -2793,7 +2793,7 @@ int qemuMonitorTextAddDevice(qemuMonitorPtr mon,
/* Otherwise, if the command succeeds, no output is sent. So
* any non-empty string shows an error */
if (STRNEQ(reply, "")) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("adding %s device failed: %s"), devicestr, reply);
goto cleanup;
}
@ -2830,19 +2830,19 @@ int qemuMonitorTextAddDrive(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to add drive '%s'"), drivestr);
goto cleanup;
}
if (strstr(reply, "unknown command:")) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("drive hotplug is not supported"));
goto cleanup;
}
if (strstr(reply, "could not open disk image")) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("open disk image file failed"));
goto cleanup;
}
@ -2878,7 +2878,7 @@ int qemuMonitorTextDriveDel(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("cannot delete %s drive"), drivestr);
goto cleanup;
}
@ -2895,7 +2895,7 @@ int qemuMonitorTextDriveDel(qemuMonitorPtr mon,
/* NB: device not found errors mean the drive was auto-deleted and we
* ignore the error */
} else if (STRNEQ(reply, "")) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("deleting %s drive failed: %s"), drivestr, reply);
goto cleanup;
}
@ -2931,17 +2931,17 @@ int qemuMonitorTextSetDrivePassphrase(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("failed to set disk password"));
goto cleanup;
}
if (strstr(reply, "unknown command:")) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("setting disk password is not supported"));
goto cleanup;
} else if (strstr(reply, "The entered password is invalid")) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("the disk password is incorrect"));
goto cleanup;
}
@ -2969,28 +2969,28 @@ int qemuMonitorTextCreateSnapshot(qemuMonitorPtr mon, const char *name)
}
if (qemuMonitorHMPCommand(mon, cmd, &reply)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to take snapshot using command '%s'"), cmd);
goto cleanup;
}
if (strstr(reply, "Error while creating snapshot") != NULL) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("Failed to take snapshot: %s"), reply);
goto cleanup;
}
else if (strstr(reply, "No block device can accept snapshots") != NULL) {
qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("this domain does not have a device to take snapshots"));
goto cleanup;
}
else if (strstr(reply, "Could not open VM state file") != NULL) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", reply);
virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply);
goto cleanup;
}
else if (strstr(reply, "Error") != NULL
&& strstr(reply, "while writing VM") != NULL) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", reply);
virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply);
goto cleanup;
}
@ -3017,39 +3017,39 @@ int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, const char *name)
}
if (qemuMonitorHMPCommand(mon, cmd, &reply)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to restore snapshot using command '%s'"),
cmd);
goto cleanup;
}
if (strstr(reply, "No block device supports snapshots") != NULL) {
qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("this domain does not have a device to load snapshots"));
goto cleanup;
}
else if (strstr(reply, "Could not find snapshot") != NULL) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("the snapshot '%s' does not exist, and was not loaded"),
name);
goto cleanup;
}
else if (strstr(reply, "Snapshots not supported on device") != NULL) {
qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", reply);
virReportError(VIR_ERR_OPERATION_INVALID, "%s", reply);
goto cleanup;
}
else if (strstr(reply, "Could not open VM state file") != NULL) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", reply);
virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply);
goto cleanup;
}
else if (strstr(reply, "Error") != NULL
&& strstr(reply, "while loading VM state") != NULL) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", reply);
virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply);
goto cleanup;
}
else if (strstr(reply, "Error") != NULL
&& strstr(reply, "while activating snapshot on") != NULL) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", reply);
virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply);
goto cleanup;
}
@ -3075,24 +3075,24 @@ int qemuMonitorTextDeleteSnapshot(qemuMonitorPtr mon, const char *name)
goto cleanup;
}
if (qemuMonitorHMPCommand(mon, cmd, &reply)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to delete snapshot using command '%s'"),
cmd);
goto cleanup;
}
if (strstr(reply, "No block device supports snapshots") != NULL) {
qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("this domain does not have a device to delete snapshots"));
goto cleanup;
}
else if (strstr(reply, "Snapshots not supported on device") != NULL) {
qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", reply);
virReportError(VIR_ERR_OPERATION_INVALID, "%s", reply);
goto cleanup;
}
else if (strstr(reply, "Error") != NULL
&& strstr(reply, "while deleting snapshot") != NULL) {
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s", reply);
virReportError(VIR_ERR_OPERATION_FAILED, "%s", reply);
goto cleanup;
}
@ -3121,14 +3121,14 @@ qemuMonitorTextDiskSnapshot(qemuMonitorPtr mon, const char *device,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply)) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to take snapshot using command '%s'"), cmd);
goto cleanup;
}
if (strstr(reply, "error while creating qcow2") != NULL ||
strstr(reply, "unknown command:") != NULL) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("Failed to take snapshot: %s"), reply);
goto cleanup;
}
@ -3159,7 +3159,7 @@ int qemuMonitorTextArbitraryCommand(qemuMonitorPtr mon, const char *cmd,
ret = qemuMonitorHMPCommand(mon, safecmd, reply);
if (ret != 0)
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to run cmd '%s'"), safecmd);
VIR_FREE(safecmd);
@ -3189,7 +3189,7 @@ int qemuMonitorTextInjectNMI(qemuMonitorPtr mon)
return 0;
fail:
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to inject NMI using command '%s'"),
cmd);
return -1;
@ -3211,7 +3211,7 @@ int qemuMonitorTextSendKey(qemuMonitorPtr mon,
virBufferAddLit(&buf, "sendkey ");
for (i = 0; i < nkeycodes; i++) {
if (keycodes[i] > 0xffff) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("keycode %d is invalid: 0x%X"),
i, keycodes[i]);
virBufferFreeAndReset(&buf);
@ -3233,14 +3233,14 @@ int qemuMonitorTextSendKey(qemuMonitorPtr mon,
cmd = virBufferContentAndReset(&buf);
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to send key using command '%s'"),
cmd);
goto cleanup;
}
if (STRNEQ(reply, "")) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
_("failed to send key '%s'"), reply);
goto cleanup;
}
@ -3266,7 +3266,7 @@ int qemuMonitorTextScreendump(qemuMonitorPtr mon, const char *file)
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("taking screenshot failed"));
goto cleanup;
}
@ -3300,7 +3300,7 @@ int qemuMonitorTextOpenGraphics(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("adding graphics client failed"));
goto cleanup;
}
@ -3339,14 +3339,14 @@ int qemuMonitorTextSetBlockIoThrottle(qemuMonitorPtr mon,
}
if (qemuMonitorHMPCommand(mon, cmd, &result) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("cannot run monitor command"));
ret = -1;
goto cleanup;
}
if (qemuMonitorTextCommandNotFound(cmd_name, result)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("Command '%s' is not found"), cmd_name);
ret = -1;
goto cleanup;
@ -3429,7 +3429,7 @@ qemuMonitorTextParseBlockIoThrottle(const char *result,
p++;
}
qemuReportError(VIR_ERR_INVALID_ARG,
virReportError(VIR_ERR_INVALID_ARG,
_("No info for device '%s'"), device);
cleanup:
@ -3445,14 +3445,14 @@ int qemuMonitorTextGetBlockIoThrottle(qemuMonitorPtr mon,
const char *cmd_name = "info block";
if (qemuMonitorHMPCommand(mon, cmd_name, &result) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("cannot run monitor command"));
ret = -1;
goto cleanup;
}
if (qemuMonitorTextCommandNotFound(cmd_name, result)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("Command '%s' is not found"), cmd_name);
ret = -1;
goto cleanup;

View File

@ -368,7 +368,7 @@ qemuProcessFindDomainDiskByPath(virDomainObjPtr vm,
if (i >= 0)
return vm->def->disks[i];
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("no disk found with path %s"),
path);
return NULL;
@ -391,7 +391,7 @@ qemuProcessFindDomainDiskByAlias(virDomainObjPtr vm,
return disk;
}
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("no disk found with alias %s"),
alias);
return NULL;
@ -411,7 +411,7 @@ qemuProcessGetVolumeQcowPassphrase(virConnectPtr conn,
virStorageEncryptionPtr enc;
if (!disk->encryption) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("disk %s does not have any encryption information"),
disk->src);
return -1;
@ -419,7 +419,7 @@ qemuProcessGetVolumeQcowPassphrase(virConnectPtr conn,
enc = disk->encryption;
if (!conn) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("cannot find secrets without a connection"));
goto cleanup;
}
@ -427,7 +427,7 @@ qemuProcessGetVolumeQcowPassphrase(virConnectPtr conn,
if (conn->secretDriver == NULL ||
conn->secretDriver->lookupByUUID == NULL ||
conn->secretDriver->getValue == NULL) {
qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("secret storage not supported"));
goto cleanup;
}
@ -436,7 +436,7 @@ qemuProcessGetVolumeQcowPassphrase(virConnectPtr conn,
enc->nsecrets != 1 ||
enc->secrets[0]->type !=
VIR_STORAGE_ENCRYPTION_SECRET_TYPE_PASSPHRASE) {
qemuReportError(VIR_ERR_XML_ERROR,
virReportError(VIR_ERR_XML_ERROR,
_("invalid <encryption> for volume %s"), disk->src);
goto cleanup;
}
@ -454,7 +454,7 @@ qemuProcessGetVolumeQcowPassphrase(virConnectPtr conn,
if (memchr(data, '\0', size) != NULL) {
memset(data, 0, size);
VIR_FREE(data);
qemuReportError(VIR_ERR_XML_ERROR,
virReportError(VIR_ERR_XML_ERROR,
_("format='qcow' passphrase for %s must not contain a "
"'\\0'"), disk->src);
goto cleanup;
@ -550,7 +550,7 @@ qemuProcessFakeReboot(void *opaque)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
goto endjob;
}
@ -563,7 +563,7 @@ qemuProcessFakeReboot(void *opaque)
qemuDomainObjExitMonitorWithDriver(driver, vm);
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("guest unexpectedly quit"));
goto endjob;
}
@ -572,7 +572,7 @@ qemuProcessFakeReboot(void *opaque)
VIR_DOMAIN_RUNNING_BOOTED,
QEMU_ASYNC_JOB_NONE) < 0) {
if (virGetLastError() == NULL)
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("resume operation failed"));
goto endjob;
}
@ -1326,14 +1326,14 @@ qemuProcessReadLogOutput(virDomainObjPtr vm,
}
if (got == buflen-1) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Process exited while reading %s log output: %s"),
what, buf);
goto cleanup;
@ -1348,7 +1348,7 @@ qemuProcessReadLogOutput(virDomainObjPtr vm,
retries--;
}
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Timed out while reading %s log output: %s"),
what, buf);
@ -1435,7 +1435,7 @@ 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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("no assigned pty for device %s"), id);
return -1;
} else {
@ -1627,7 +1627,7 @@ 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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("process exited while connecting to monitor: %s"),
buf);
ret = -1;
@ -1672,7 +1672,7 @@ qemuProcessDetectVcpuPIDs(struct qemud_driver *driver,
qemuDomainObjExitMonitorWithDriver(driver, vm);
if (ncpupids != vm->def->vcpus) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("got wrong number of vCPU pids from QEMU monitor. "
"got %d, wanted %d"),
ncpupids, vm->def->vcpus);
@ -1720,7 +1720,7 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm,
}
if (numa_available() < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Host kernel is not aware of NUMA."));
return -1;
}
@ -1731,7 +1731,7 @@ 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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Host cannot support NUMA node %d"), i);
return -1;
}
@ -1760,7 +1760,7 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm,
}
if (nnodes != 1) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("NUMA memory tuning in 'preferred' mode "
"only supports single node"));
goto cleanup;
@ -1774,7 +1774,7 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm,
/* XXX: Shouldn't go here, as we already do checking when
* parsing domain XML.
*/
qemuReportError(VIR_ERR_XML_ERROR,
virReportError(VIR_ERR_XML_ERROR,
"%s", _("Invalid mode for memory NUMA tuning."));
goto cleanup;
}
@ -1790,7 +1790,7 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm,
const char *nodemask ATTRIBUTE_UNUSED)
{
if (vm->def->numatune.memory.nodemask) {
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("libvirt is compiled without NUMA tuning support"));
return -1;
@ -1814,7 +1814,7 @@ qemuGetNumadAdvice(virDomainDefPtr def)
virCommandSetOutputBuffer(cmd, &output);
if (virCommandRun(cmd, NULL) < 0)
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Failed to query numad for the "
"advisory nodeset"));
@ -1825,7 +1825,7 @@ qemuGetNumadAdvice(virDomainDefPtr def)
static char *
qemuGetNumadAdvice(virDomainDefPtr def ATTRIBUTE_UNUSED)
{
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("numad is not available on this host"));
return NULL;
}
@ -1920,7 +1920,7 @@ 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",
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,7 +1961,7 @@ qemuProcessSetVcpuAffinites(virConnectPtr conn,
return 0;
if (priv->vcpupids == NULL) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("cpu affinity is not supported"));
return -1;
}
@ -2330,7 +2330,7 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
if (qemuProcessAssignNextPCIAddress(&(vm->def->disks[i]->info),
vendor, product,
addrs, naddrs) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for VirtIO disk %s"),
vm->def->disks[i]->dst);
return -1;
@ -2344,7 +2344,7 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
if (qemuProcessAssignNextPCIAddress(&(vm->def->nets[i]->info),
vendor, product,
addrs, naddrs) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for %s NIC"),
vm->def->nets[i]->model);
return -1;
@ -2358,7 +2358,7 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
if (qemuProcessAssignNextPCIAddress(&(vm->def->controllers[i]->info),
vendor, product,
addrs, naddrs) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for controller %s"),
virDomainControllerTypeToString(vm->def->controllers[i]->type));
return -1;
@ -2372,7 +2372,7 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
if (qemuProcessAssignNextPCIAddress(&(vm->def->videos[i]->info),
vendor, product,
addrs, naddrs) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for video adapter %s"),
virDomainVideoTypeToString(vm->def->videos[i]->type));
return -1;
@ -2386,7 +2386,7 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
if (qemuProcessAssignNextPCIAddress(&(vm->def->sounds[i]->info),
vendor, product,
addrs, naddrs) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for sound adapter %s"),
virDomainSoundModelTypeToString(vm->def->sounds[i]->model));
return -1;
@ -2399,7 +2399,7 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
if (qemuProcessAssignNextPCIAddress(&(vm->def->watchdog->info),
vendor, product,
addrs, naddrs) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for watchdog %s"),
virDomainWatchdogModelTypeToString(vm->def->watchdog->model));
return -1;
@ -2411,7 +2411,7 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
if (qemuProcessAssignNextPCIAddress(&(vm->def->memballoon->info),
vendor, product,
addrs, naddrs) < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find PCI address for balloon %s"),
virDomainMemballoonModelTypeToString(vm->def->memballoon->model));
return -1;
@ -3273,7 +3273,7 @@ qemuProcessReconnectHelper(void *payload,
virConnectClose(data->conn);
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not create thread. QEMU initialization "
"might be incomplete"));
if (qemuDomainObjEndJob(src->driver, obj) == 0) {
@ -3354,7 +3354,7 @@ int qemuProcessStart(virConnectPtr conn,
VIR_DEBUG("Beginning VM startup process");
if (virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("VM is already active"));
return -1;
}
@ -3420,7 +3420,7 @@ 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,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to find an unused VNC port"));
goto cleanup;
}
@ -3432,7 +3432,7 @@ int qemuProcessStart(virConnectPtr conn,
port = qemuProcessNextFreePort(driver, QEMU_VNC_PORT_MIN);
if (port < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to find an unused SPICE port"));
goto cleanup;
}
@ -3446,7 +3446,7 @@ int qemuProcessStart(virConnectPtr conn,
int tlsPort = qemuProcessNextFreePort(driver,
vm->def->graphics[0]->data.spice.port + 1);
if (tlsPort < 0) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Unable to find an unused SPICE TLS port"));
qemuProcessReturnPort(driver, port);
goto cleanup;
@ -3492,7 +3492,7 @@ 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",
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."));
@ -3658,7 +3658,7 @@ 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,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Domain %s didn't show up"), vm->def->name);
ret = -1;
}
@ -3790,7 +3790,7 @@ 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,
virReportError(VIR_ERR_OVERFLOW,
_("unable to set balloon to %lld"),
vm->def->mem.cur_balloon);
goto cleanup;
@ -3809,7 +3809,7 @@ int qemuProcessStart(virConnectPtr conn,
VIR_DOMAIN_RUNNING_BOOTED,
QEMU_ASYNC_JOB_NONE) < 0) {
if (virGetLastError() == NULL)
qemuReportError(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("resume operation failed"));
goto cleanup;
}
@ -4199,7 +4199,7 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
VIR_DEBUG("Beginning VM attach process");
if (virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("VM is already active"));
return -1;
}