提交 3b7399b5 编写于 作者: D Daniel P. Berrange

Replace use of qemuReportError with virReportError

Update the QEMU driver to use virReportError instead of
the qemuReportError custom macro
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 4e532f2e
......@@ -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
......
......@@ -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"));
}
......
......@@ -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;
}
......
......@@ -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;
......
此差异已折叠。
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
此差异已折叠。
......@@ -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);
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册