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:
parent
4e532f2e3d
commit
3b7399b5c9
1
cfg.mk
1
cfg.mk
@ -517,7 +517,6 @@ msg_gen_function += lxcError
|
|||||||
msg_gen_function += libxlError
|
msg_gen_function += libxlError
|
||||||
msg_gen_function += nodeReportError
|
msg_gen_function += nodeReportError
|
||||||
msg_gen_function += openvzError
|
msg_gen_function += openvzError
|
||||||
msg_gen_function += qemuReportError
|
|
||||||
msg_gen_function += regerror
|
msg_gen_function += regerror
|
||||||
msg_gen_function += remoteError
|
msg_gen_function += remoteError
|
||||||
msg_gen_function += statsError
|
msg_gen_function += statsError
|
||||||
|
@ -204,22 +204,22 @@ qemuAgentOpenUnix(const char *monitor, pid_t cpid, bool *inProgress)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virSetNonBlock(monfd) < 0) {
|
if (virSetNonBlock(monfd) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("Unable to put monitor into non-blocking mode"));
|
"%s", _("Unable to put monitor into non-blocking mode"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virSetCloseExec(monfd) < 0) {
|
if (virSetCloseExec(monfd) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("Unable to set monitor close-on-exec flag"));
|
"%s", _("Unable to set monitor close-on-exec flag"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&addr, 0, sizeof(addr));
|
memset(&addr, 0, sizeof(addr));
|
||||||
addr.sun_family = AF_UNIX;
|
addr.sun_family = AF_UNIX;
|
||||||
if (virStrcpyStatic(addr.sun_path, monitor) == NULL) {
|
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);
|
_("Agent path %s too big for destination"), monitor);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,14 +269,14 @@ qemuAgentOpenPty(const char *monitor)
|
|||||||
int monfd;
|
int monfd;
|
||||||
|
|
||||||
if ((monfd = open(monitor, O_RDWR | O_NONBLOCK)) < 0) {
|
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);
|
_("Unable to open monitor path %s"), monitor);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virSetCloseExec(monfd) < 0) {
|
if (virSetCloseExec(monfd) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("Unable to set monitor close-on-exec flag"));
|
"%s", _("Unable to set monitor close-on-exec flag"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -331,8 +331,8 @@ qemuAgentIOProcessLine(qemuAgentPtr mon,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (obj->type != VIR_JSON_TYPE_OBJECT) {
|
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);
|
_("Parsed JSON reply '%s' isn't an object"), line);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,12 +362,12 @@ qemuAgentIOProcessLine(qemuAgentPtr mon,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unexpected JSON reply '%s'"), line);
|
_("Unexpected JSON reply '%s'"), line);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unknown JSON reply '%s'"), line);
|
_("Unknown JSON reply '%s'"), line);
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
@ -609,9 +609,9 @@ qemuAgentIO(int watch, int fd, int events, void *opaque) {
|
|||||||
if (mon->fd != fd || mon->watch != watch) {
|
if (mon->fd != fd || mon->watch != watch) {
|
||||||
if (events & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR))
|
if (events & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR))
|
||||||
eof = true;
|
eof = true;
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("event from unexpected fd %d!=%d / watch %d!=%d"),
|
_("event from unexpected fd %d!=%d / watch %d!=%d"),
|
||||||
mon->fd, fd, mon->watch, watch);
|
mon->fd, fd, mon->watch, watch);
|
||||||
error = true;
|
error = true;
|
||||||
} else if (mon->lastError.code != VIR_ERR_OK) {
|
} else if (mon->lastError.code != VIR_ERR_OK) {
|
||||||
if (events & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR))
|
if (events & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR))
|
||||||
@ -649,23 +649,23 @@ qemuAgentIO(int watch, int fd, int events, void *opaque) {
|
|||||||
|
|
||||||
if (!error &&
|
if (!error &&
|
||||||
events & VIR_EVENT_HANDLE_HANGUP) {
|
events & VIR_EVENT_HANDLE_HANGUP) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("End of file from monitor"));
|
_("End of file from monitor"));
|
||||||
eof = 1;
|
eof = 1;
|
||||||
events &= ~VIR_EVENT_HANDLE_HANGUP;
|
events &= ~VIR_EVENT_HANDLE_HANGUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!error && !eof &&
|
if (!error && !eof &&
|
||||||
events & VIR_EVENT_HANDLE_ERROR) {
|
events & VIR_EVENT_HANDLE_ERROR) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Invalid file descriptor while waiting for monitor"));
|
_("Invalid file descriptor while waiting for monitor"));
|
||||||
eof = 1;
|
eof = 1;
|
||||||
events &= ~VIR_EVENT_HANDLE_ERROR;
|
events &= ~VIR_EVENT_HANDLE_ERROR;
|
||||||
}
|
}
|
||||||
if (!error && events) {
|
if (!error && events) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unhandled event %d for monitor fd %d"),
|
_("Unhandled event %d for monitor fd %d"),
|
||||||
events, mon->fd);
|
events, mon->fd);
|
||||||
error = 1;
|
error = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -677,8 +677,8 @@ qemuAgentIO(int watch, int fd, int events, void *opaque) {
|
|||||||
} else {
|
} else {
|
||||||
virErrorPtr err = virGetLastError();
|
virErrorPtr err = virGetLastError();
|
||||||
if (!err)
|
if (!err)
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Error while processing monitor IO"));
|
_("Error while processing monitor IO"));
|
||||||
virCopyLastError(&mon->lastError);
|
virCopyLastError(&mon->lastError);
|
||||||
virResetLastError();
|
virResetLastError();
|
||||||
}
|
}
|
||||||
@ -734,8 +734,8 @@ qemuAgentOpen(virDomainObjPtr vm,
|
|||||||
qemuAgentPtr mon;
|
qemuAgentPtr mon;
|
||||||
|
|
||||||
if (!cb || !cb->eofNotify) {
|
if (!cb || !cb->eofNotify) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("EOF notify callback must be supplied"));
|
_("EOF notify callback must be supplied"));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -745,14 +745,14 @@ qemuAgentOpen(virDomainObjPtr vm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virMutexInit(&mon->lock) < 0) {
|
if (virMutexInit(&mon->lock) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("cannot initialize monitor mutex"));
|
_("cannot initialize monitor mutex"));
|
||||||
VIR_FREE(mon);
|
VIR_FREE(mon);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (virCondInit(&mon->notify) < 0) {
|
if (virCondInit(&mon->notify) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("cannot initialize monitor condition"));
|
_("cannot initialize monitor condition"));
|
||||||
virMutexDestroy(&mon->lock);
|
virMutexDestroy(&mon->lock);
|
||||||
VIR_FREE(mon);
|
VIR_FREE(mon);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -774,9 +774,9 @@ qemuAgentOpen(virDomainObjPtr vm,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unable to handle monitor type: %s"),
|
_("unable to handle monitor type: %s"),
|
||||||
virDomainChrTypeToString(config->type));
|
virDomainChrTypeToString(config->type));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -792,8 +792,8 @@ qemuAgentOpen(virDomainObjPtr vm,
|
|||||||
0),
|
0),
|
||||||
qemuAgentIO,
|
qemuAgentIO,
|
||||||
mon, qemuAgentUnwatch)) < 0) {
|
mon, qemuAgentUnwatch)) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("unable to register monitor events"));
|
_("unable to register monitor events"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
qemuAgentRef(mon);
|
qemuAgentRef(mon);
|
||||||
@ -886,12 +886,12 @@ static int qemuAgentSend(qemuAgentPtr mon,
|
|||||||
if ((timeout && virCondWaitUntil(&mon->notify, &mon->lock, then) < 0) ||
|
if ((timeout && virCondWaitUntil(&mon->notify, &mon->lock, then) < 0) ||
|
||||||
(!timeout && virCondWait(&mon->notify, &mon->lock) < 0)) {
|
(!timeout && virCondWait(&mon->notify, &mon->lock) < 0)) {
|
||||||
if (errno == ETIMEDOUT) {
|
if (errno == ETIMEDOUT) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Guest agent not available for now"));
|
_("Guest agent not available for now"));
|
||||||
ret = -2;
|
ret = -2;
|
||||||
} else {
|
} else {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Unable to wait on monitor condition"));
|
_("Unable to wait on monitor condition"));
|
||||||
}
|
}
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -959,23 +959,23 @@ qemuAgentGuestSync(qemuAgentPtr mon)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!sync_msg.rxObject) {
|
if (!sync_msg.rxObject) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Missing monitor reply object"));
|
_("Missing monitor reply object"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virJSONValueObjectGetNumberUlong(sync_msg.rxObject,
|
if (virJSONValueObjectGetNumberUlong(sync_msg.rxObject,
|
||||||
"return", &id_ret) < 0) {
|
"return", &id_ret) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Malformed return value"));
|
_("Malformed return value"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_DEBUG("Guest returned ID: %llu", id_ret);
|
VIR_DEBUG("Guest returned ID: %llu", id_ret);
|
||||||
if (id_ret != id) {
|
if (id_ret != id) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Guest agent returned ID: %llu instead of %llu"),
|
_("Guest agent returned ID: %llu instead of %llu"),
|
||||||
id_ret, id);
|
id_ret, id);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@ -1029,8 +1029,8 @@ qemuAgentCommand(qemuAgentPtr mon,
|
|||||||
if (await_event) {
|
if (await_event) {
|
||||||
VIR_DEBUG("Woken up by event %d", await_event);
|
VIR_DEBUG("Woken up by event %d", await_event);
|
||||||
} else {
|
} else {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Missing monitor reply object"));
|
_("Missing monitor reply object"));
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1128,14 +1128,14 @@ qemuAgentCheckError(virJSONValuePtr cmd,
|
|||||||
|
|
||||||
/* Only send the user the command name + friendly error */
|
/* Only send the user the command name + friendly error */
|
||||||
if (!error)
|
if (!error)
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unable to execute QEMU command '%s'"),
|
_("unable to execute QEMU command '%s'"),
|
||||||
qemuAgentCommandName(cmd));
|
qemuAgentCommandName(cmd));
|
||||||
else
|
else
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unable to execute QEMU command '%s': %s"),
|
_("unable to execute QEMU command '%s': %s"),
|
||||||
qemuAgentCommandName(cmd),
|
qemuAgentCommandName(cmd),
|
||||||
qemuAgentStringifyError(error));
|
qemuAgentStringifyError(error));
|
||||||
|
|
||||||
VIR_FREE(cmdstr);
|
VIR_FREE(cmdstr);
|
||||||
VIR_FREE(replystr);
|
VIR_FREE(replystr);
|
||||||
@ -1146,9 +1146,9 @@ qemuAgentCheckError(virJSONValuePtr cmd,
|
|||||||
|
|
||||||
VIR_DEBUG("Neither 'return' nor 'error' is set in the JSON reply %s: %s",
|
VIR_DEBUG("Neither 'return' nor 'error' is set in the JSON reply %s: %s",
|
||||||
cmdstr, replystr);
|
cmdstr, replystr);
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unable to execute QEMU command '%s'"),
|
_("unable to execute QEMU command '%s'"),
|
||||||
qemuAgentCommandName(cmd));
|
qemuAgentCommandName(cmd));
|
||||||
VIR_FREE(cmdstr);
|
VIR_FREE(cmdstr);
|
||||||
VIR_FREE(replystr);
|
VIR_FREE(replystr);
|
||||||
return -1;
|
return -1;
|
||||||
@ -1178,9 +1178,9 @@ qemuAgentMakeCommand(const char *cmdname,
|
|||||||
char type;
|
char type;
|
||||||
|
|
||||||
if (strlen(key) < 3) {
|
if (strlen(key) < 3) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("argument key '%s' is too short, missing type prefix"),
|
_("argument key '%s' is too short, missing type prefix"),
|
||||||
key);
|
key);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1232,8 +1232,8 @@ qemuAgentMakeCommand(const char *cmdname,
|
|||||||
ret = virJSONValueObjectAppendNull(jargs, key);
|
ret = virJSONValueObjectAppendNull(jargs, key);
|
||||||
} break;
|
} break;
|
||||||
default:
|
default:
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unsupported data type '%c' for arg '%s'"), type, key - 2);
|
_("unsupported data type '%c' for arg '%s'"), type, key - 2);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@ -1332,8 +1332,8 @@ int qemuAgentFSFreeze(qemuAgentPtr mon)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virJSONValueObjectGetNumberInt(reply, "return", &ret) < 0) {
|
if (virJSONValueObjectGetNumberInt(reply, "return", &ret) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("malformed return value"));
|
_("malformed return value"));
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
@ -1369,8 +1369,8 @@ int qemuAgentFSThaw(qemuAgentPtr mon)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virJSONValueObjectGetNumberInt(reply, "return", &ret) < 0) {
|
if (virJSONValueObjectGetNumberInt(reply, "return", &ret) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("malformed return value"));
|
_("malformed return value"));
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
@ -1226,9 +1226,9 @@ qemuCapsComputeCmdFlags(const char *help,
|
|||||||
if (version >= 15000 ||
|
if (version >= 15000 ||
|
||||||
(version >= 12000 && strstr(help, "libvirt"))) {
|
(version >= 12000 && strstr(help, "libvirt"))) {
|
||||||
if (check_yajl) {
|
if (check_yajl) {
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("this qemu binary requires libvirt to be "
|
_("this qemu binary requires libvirt to be "
|
||||||
"compiled with yajl"));
|
"compiled with yajl"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
qemuCapsSet(flags, QEMU_CAPS_NETDEV);
|
qemuCapsSet(flags, QEMU_CAPS_NETDEV);
|
||||||
@ -1363,9 +1363,9 @@ fail:
|
|||||||
if (!p)
|
if (!p)
|
||||||
p = strchr(help, '\0');
|
p = strchr(help, '\0');
|
||||||
|
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot parse %s version number in '%.*s'"),
|
_("cannot parse %s version number in '%.*s'"),
|
||||||
qemu, (int) (p - help), help);
|
qemu, (int) (p - help), help);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
return -1;
|
return -1;
|
||||||
@ -1589,8 +1589,8 @@ int qemuCapsExtractVersion(virCapsPtr caps,
|
|||||||
"hvm",
|
"hvm",
|
||||||
ut.machine,
|
ut.machine,
|
||||||
"qemu")) == NULL) {
|
"qemu")) == NULL) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Cannot find suitable emulator for %s"), ut.machine);
|
_("Cannot find suitable emulator for %s"), ut.machine);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,8 +310,8 @@ int qemuSetupCgroup(struct qemud_driver *driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("Block I/O tuning is not available on this host"));
|
_("Block I/O tuning is not available on this host"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -333,8 +333,8 @@ int qemuSetupCgroup(struct qemud_driver *driver,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("Block I/O tuning is not available on this host"));
|
_("Block I/O tuning is not available on this host"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -372,8 +372,8 @@ int qemuSetupCgroup(struct qemud_driver *driver,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("Memory cgroup is not available on this host"));
|
_("Memory cgroup is not available on this host"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -387,8 +387,8 @@ int qemuSetupCgroup(struct qemud_driver *driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("CPU tuning is not available on this host"));
|
_("CPU tuning is not available on this host"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,8 +405,8 @@ int qemuSetupCgroup(struct qemud_driver *driver,
|
|||||||
mask = virDomainCpuSetFormat(vm->def->numatune.memory.nodemask,
|
mask = virDomainCpuSetFormat(vm->def->numatune.memory.nodemask,
|
||||||
VIR_DOMAIN_CPUMASK_LEN);
|
VIR_DOMAIN_CPUMASK_LEN);
|
||||||
if (!mask) {
|
if (!mask) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("failed to convert memory nodemask"));
|
_("failed to convert memory nodemask"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -585,9 +585,9 @@ int qemuRemoveCgroup(struct qemud_driver *driver,
|
|||||||
rc = virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0);
|
rc = virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unable to find cgroup for %s"),
|
_("Unable to find cgroup for %s"),
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -140,9 +140,9 @@ int qemudLoadDriverConfig(struct qemud_driver *driver,
|
|||||||
|
|
||||||
|
|
||||||
#define CHECK_TYPE(name,typ) if (p && p->type != (typ)) { \
|
#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, \
|
"%s: %s: expected type " #typ, \
|
||||||
filename, (name)); \
|
filename, (name)); \
|
||||||
virConfFree(conf); \
|
virConfFree(conf); \
|
||||||
return -1; \
|
return -1; \
|
||||||
}
|
}
|
||||||
@ -535,16 +535,16 @@ qemuDriverCloseCallbackSet(struct qemud_driver *driver,
|
|||||||
closeDef = virHashLookup(driver->closeCallbacks, uuidstr);
|
closeDef = virHashLookup(driver->closeCallbacks, uuidstr);
|
||||||
if (closeDef) {
|
if (closeDef) {
|
||||||
if (closeDef->conn != conn) {
|
if (closeDef->conn != conn) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Close callback for domain %s already registered"
|
_("Close callback for domain %s already registered"
|
||||||
" with another connection %p"),
|
" with another connection %p"),
|
||||||
vm->def->name, closeDef->conn);
|
vm->def->name, closeDef->conn);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (closeDef->cb && closeDef->cb != cb) {
|
if (closeDef->cb && closeDef->cb != cb) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Another close callback is already defined for"
|
_("Another close callback is already defined for"
|
||||||
" domain %s"), vm->def->name);
|
" domain %s"), vm->def->name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -582,9 +582,9 @@ qemuDriverCloseCallbackUnset(struct qemud_driver *driver,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (closeDef->cb && closeDef->cb != cb) {
|
if (closeDef->cb && closeDef->cb != cb) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Trying to remove mismatching close callback for"
|
_("Trying to remove mismatching close callback for"
|
||||||
" domain %s"), vm->def->name);
|
" domain %s"), vm->def->name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,10 +167,6 @@ struct _qemuDomainCmdlineDef {
|
|||||||
# define QEMUD_MIGRATION_FIRST_PORT 49152
|
# define QEMUD_MIGRATION_FIRST_PORT 49152
|
||||||
# define QEMUD_MIGRATION_NUM_PORTS 64
|
# 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 qemuDriverLock(struct qemud_driver *driver);
|
||||||
void qemuDriverUnlock(struct qemud_driver *driver);
|
void qemuDriverUnlock(struct qemud_driver *driver);
|
||||||
|
@ -344,8 +344,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
|
|||||||
|
|
||||||
if (!(monitorpath =
|
if (!(monitorpath =
|
||||||
virXPathString("string(./monitor[1]/@path)", ctxt))) {
|
virXPathString("string(./monitor[1]/@path)", ctxt))) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("no monitor path"));
|
"%s", _("no monitor path"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -371,9 +371,9 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
VIR_FREE(monitorpath);
|
VIR_FREE(monitorpath);
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unsupported monitor type '%s'"),
|
_("unsupported monitor type '%s'"),
|
||||||
virDomainChrTypeToString(priv->monConfig->type));
|
virDomainChrTypeToString(priv->monConfig->type));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -402,8 +402,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((n = virXPathNodeSet("./qemuCaps/flag", ctxt, &nodes)) < 0) {
|
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"));
|
"%s", _("failed to parse qemu capabilities flags"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
@ -415,8 +415,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
|
|||||||
if (str) {
|
if (str) {
|
||||||
int flag = qemuCapsTypeFromString(str);
|
int flag = qemuCapsTypeFromString(str);
|
||||||
if (flag < 0) {
|
if (flag < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unknown qemu capabilities flag %s"), str);
|
_("Unknown qemu capabilities flag %s"), str);
|
||||||
VIR_FREE(str);
|
VIR_FREE(str);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -435,8 +435,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
|
|||||||
int type;
|
int type;
|
||||||
|
|
||||||
if ((type = qemuDomainJobTypeFromString(tmp)) < 0) {
|
if ((type = qemuDomainJobTypeFromString(tmp)) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unknown job type %s"), tmp);
|
_("Unknown job type %s"), tmp);
|
||||||
VIR_FREE(tmp);
|
VIR_FREE(tmp);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -448,8 +448,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
|
|||||||
int async;
|
int async;
|
||||||
|
|
||||||
if ((async = qemuDomainAsyncJobTypeFromString(tmp)) < 0) {
|
if ((async = qemuDomainAsyncJobTypeFromString(tmp)) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unknown async job type %s"), tmp);
|
_("Unknown async job type %s"), tmp);
|
||||||
VIR_FREE(tmp);
|
VIR_FREE(tmp);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -459,8 +459,8 @@ static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
|
|||||||
if ((tmp = virXPathString("string(./job[1]/@phase)", ctxt))) {
|
if ((tmp = virXPathString("string(./job[1]/@phase)", ctxt))) {
|
||||||
priv->job.phase = qemuDomainAsyncJobPhaseFromString(async, tmp);
|
priv->job.phase = qemuDomainAsyncJobPhaseFromString(async, tmp);
|
||||||
if (priv->job.phase < 0) {
|
if (priv->job.phase < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unknown job phase %s"), tmp);
|
_("Unknown job phase %s"), tmp);
|
||||||
VIR_FREE(tmp);
|
VIR_FREE(tmp);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -514,9 +514,9 @@ qemuDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED,
|
|||||||
int n, i;
|
int n, i;
|
||||||
|
|
||||||
if (xmlXPathRegisterNs(ctxt, BAD_CAST "qemu", BAD_CAST QEMU_NAMESPACE_HREF) < 0) {
|
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'"),
|
_("Failed to register xml namespace '%s'"),
|
||||||
QEMU_NAMESPACE_HREF);
|
QEMU_NAMESPACE_HREF);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -537,8 +537,8 @@ qemuDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED,
|
|||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
cmd->args[cmd->num_args] = virXMLPropString(nodes[i], "value");
|
cmd->args[cmd->num_args] = virXMLPropString(nodes[i], "value");
|
||||||
if (cmd->args[cmd->num_args] == NULL) {
|
if (cmd->args[cmd->num_args] == NULL) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("No qemu command-line argument specified"));
|
"%s", _("No qemu command-line argument specified"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
cmd->num_args++;
|
cmd->num_args++;
|
||||||
@ -563,23 +563,23 @@ qemuDomainDefNamespaceParse(xmlDocPtr xml ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
tmp = virXMLPropString(nodes[i], "name");
|
tmp = virXMLPropString(nodes[i], "name");
|
||||||
if (tmp == NULL) {
|
if (tmp == NULL) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("No qemu environment name specified"));
|
"%s", _("No qemu environment name specified"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (tmp[0] == '\0') {
|
if (tmp[0] == '\0') {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("Empty qemu environment name specified"));
|
"%s", _("Empty qemu environment name specified"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (!c_isalpha(tmp[0]) && tmp[0] != '_') {
|
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"));
|
"%s", _("Invalid environment name, it must begin with a letter or underscore"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (strspn(tmp, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_") != strlen(tmp)) {
|
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"));
|
"%s", _("Invalid environment name, it must contain only alphanumerics and underscore"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -838,13 +838,13 @@ error:
|
|||||||
priv->job.owner, priv->job.asyncOwner);
|
priv->job.owner, priv->job.asyncOwner);
|
||||||
|
|
||||||
if (errno == ETIMEDOUT)
|
if (errno == ETIMEDOUT)
|
||||||
qemuReportError(VIR_ERR_OPERATION_TIMEOUT,
|
virReportError(VIR_ERR_OPERATION_TIMEOUT,
|
||||||
"%s", _("cannot acquire state change lock"));
|
"%s", _("cannot acquire state change lock"));
|
||||||
else if (driver->max_queued &&
|
else if (driver->max_queued &&
|
||||||
priv->jobs_queued > 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 "
|
"%s", _("cannot acquire state change lock "
|
||||||
"due to max_queued limit"));
|
"due to max_queued limit"));
|
||||||
else
|
else
|
||||||
virReportSystemError(errno,
|
virReportSystemError(errno,
|
||||||
"%s", _("cannot acquire job mutex"));
|
"%s", _("cannot acquire job mutex"));
|
||||||
@ -899,8 +899,8 @@ int qemuDomainObjBeginJobWithDriver(struct qemud_driver *driver,
|
|||||||
enum qemuDomainJob job)
|
enum qemuDomainJob job)
|
||||||
{
|
{
|
||||||
if (job <= QEMU_JOB_NONE || job >= QEMU_JOB_ASYNC) {
|
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"));
|
_("Attempt to start invalid job"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -971,8 +971,8 @@ qemuDomainObjEnterMonitorInternal(struct qemud_driver *driver,
|
|||||||
|
|
||||||
if (asyncJob != QEMU_ASYNC_JOB_NONE) {
|
if (asyncJob != QEMU_ASYNC_JOB_NONE) {
|
||||||
if (asyncJob != priv->job.asyncJob) {
|
if (asyncJob != priv->job.asyncJob) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unexpected async job %d"), asyncJob);
|
_("unexpected async job %d"), asyncJob);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (priv->job.asyncOwner != virThreadSelfID())
|
if (priv->job.asyncOwner != virThreadSelfID())
|
||||||
@ -983,8 +983,8 @@ qemuDomainObjEnterMonitorInternal(struct qemud_driver *driver,
|
|||||||
QEMU_ASYNC_JOB_NONE) < 0)
|
QEMU_ASYNC_JOB_NONE) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
if (!virDomainObjIsActive(obj)) {
|
if (!virDomainObjIsActive(obj)) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||||
_("domain is no longer running"));
|
_("domain is no longer running"));
|
||||||
/* Still referenced by the containing async job. */
|
/* Still referenced by the containing async job. */
|
||||||
ignore_value(qemuDomainObjEndJob(driver, obj));
|
ignore_value(qemuDomainObjEndJob(driver, obj));
|
||||||
return -1;
|
return -1;
|
||||||
@ -1241,8 +1241,8 @@ qemuDomainDefFormatBuf(struct qemud_driver *driver,
|
|||||||
def_cpu &&
|
def_cpu &&
|
||||||
(def_cpu->mode != VIR_CPU_MODE_CUSTOM || def_cpu->model)) {
|
(def_cpu->mode != VIR_CPU_MODE_CUSTOM || def_cpu->model)) {
|
||||||
if (!driver->caps || !driver->caps->host.cpu) {
|
if (!driver->caps || !driver->caps->host.cpu) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
"%s", _("cannot get host CPU capabilities"));
|
"%s", _("cannot get host CPU capabilities"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1575,8 +1575,8 @@ qemuFindQemuImgBinary(struct qemud_driver *driver)
|
|||||||
if (!driver->qemuImgBinary)
|
if (!driver->qemuImgBinary)
|
||||||
driver->qemuImgBinary = virFindFileInPath("qemu-img");
|
driver->qemuImgBinary = virFindFileInPath("qemu-img");
|
||||||
if (!driver->qemuImgBinary)
|
if (!driver->qemuImgBinary)
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("unable to find kvm-img or qemu-img"));
|
"%s", _("unable to find kvm-img or qemu-img"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return driver->qemuImgBinary;
|
return driver->qemuImgBinary;
|
||||||
@ -1672,10 +1672,10 @@ qemuDomainSnapshotForEachQcow2Raw(struct qemud_driver *driver,
|
|||||||
qemuDomainSnapshotForEachQcow2Raw(driver, def, name,
|
qemuDomainSnapshotForEachQcow2Raw(driver, def, name,
|
||||||
"-d", false, i);
|
"-d", false, i);
|
||||||
}
|
}
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
_("Disk device '%s' does not support"
|
_("Disk device '%s' does not support"
|
||||||
" snapshotting"),
|
" snapshotting"),
|
||||||
def->disks[i]->dst);
|
def->disks[i]->dst);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -31,6 +31,8 @@
|
|||||||
#include "hostusb.h"
|
#include "hostusb.h"
|
||||||
#include "virnetdev.h"
|
#include "virnetdev.h"
|
||||||
|
|
||||||
|
#define VIR_FROM_THIS VIR_FROM_QEMU
|
||||||
|
|
||||||
static pciDeviceList *
|
static pciDeviceList *
|
||||||
qemuGetPciHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs)
|
qemuGetPciHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs)
|
||||||
{
|
{
|
||||||
@ -271,10 +273,11 @@ qemuDomainHostdevNetConfigVirtPortProfile(const char *linkdev, int vf,
|
|||||||
case VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH:
|
case VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH:
|
||||||
case VIR_NETDEV_VPORT_PROFILE_8021QBG:
|
case VIR_NETDEV_VPORT_PROFILE_8021QBG:
|
||||||
case VIR_NETDEV_VPORT_PROFILE_LAST:
|
case VIR_NETDEV_VPORT_PROFILE_LAST:
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("virtualport type %s is "
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
"currently not supported on interfaces of type "
|
_("virtualport type %s is "
|
||||||
"hostdev"),
|
"currently not supported on interfaces of type "
|
||||||
virNetDevVPortTypeToString(virtPort->virtPortType));
|
"hostdev"),
|
||||||
|
virNetDevVPortTypeToString(virtPort->virtPortType));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_NETDEV_VPORT_PROFILE_8021QBH:
|
case VIR_NETDEV_VPORT_PROFILE_8021QBH:
|
||||||
@ -307,9 +310,9 @@ qemuDomainHostdevNetConfigReplace(virDomainHostdevDefPtr hostdev,
|
|||||||
|
|
||||||
isvf = qemuDomainHostdevIsVirtualFunction(hostdev);
|
isvf = qemuDomainHostdevIsVirtualFunction(hostdev);
|
||||||
if (isvf <= 0) {
|
if (isvf <= 0) {
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("Interface type hostdev is currently supported on"
|
_("Interface type hostdev is currently supported on"
|
||||||
" SR-IOV Virtual Functions only"));
|
" SR-IOV Virtual Functions only"));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,9 +348,9 @@ qemuDomainHostdevNetConfigRestore(virDomainHostdevDefPtr hostdev,
|
|||||||
|
|
||||||
isvf = qemuDomainHostdevIsVirtualFunction(hostdev);
|
isvf = qemuDomainHostdevIsVirtualFunction(hostdev);
|
||||||
if (isvf <= 0) {
|
if (isvf <= 0) {
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("Interface type hostdev is currently supported on"
|
_("Interface type hostdev is currently supported on"
|
||||||
" SR-IOV Virtual Functions only"));
|
" SR-IOV Virtual Functions only"));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -399,9 +402,9 @@ int qemuPrepareHostdevPCIDevices(struct qemud_driver *driver,
|
|||||||
pciDevice *other;
|
pciDevice *other;
|
||||||
|
|
||||||
if (!pciDeviceIsAssignable(dev, !driver->relaxedACS)) {
|
if (!pciDeviceIsAssignable(dev, !driver->relaxedACS)) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
_("PCI device %s is not assignable"),
|
_("PCI device %s is not assignable"),
|
||||||
pciDeviceGetName(dev));
|
pciDeviceGetName(dev));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
/* The device is in use by other active domain if
|
/* The device is in use by other active domain if
|
||||||
@ -411,13 +414,13 @@ int qemuPrepareHostdevPCIDevices(struct qemud_driver *driver,
|
|||||||
const char *other_name = pciDeviceGetUsedBy(other);
|
const char *other_name = pciDeviceGetUsedBy(other);
|
||||||
|
|
||||||
if (other_name)
|
if (other_name)
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
_("PCI device %s is in use by domain %s"),
|
_("PCI device %s is in use by domain %s"),
|
||||||
pciDeviceGetName(dev), other_name);
|
pciDeviceGetName(dev), other_name);
|
||||||
else
|
else
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
_("PCI device %s is already in use"),
|
_("PCI device %s is already in use"),
|
||||||
pciDeviceGetName(dev));
|
pciDeviceGetName(dev));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -579,13 +582,13 @@ qemuPrepareHostdevUSBDevices(struct qemud_driver *driver,
|
|||||||
const char *other_name = usbDeviceGetUsedBy(tmp);
|
const char *other_name = usbDeviceGetUsedBy(tmp);
|
||||||
|
|
||||||
if (other_name)
|
if (other_name)
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
_("USB device %s is in use by domain %s"),
|
_("USB device %s is in use by domain %s"),
|
||||||
usbDeviceGetName(tmp), other_name);
|
usbDeviceGetName(tmp), other_name);
|
||||||
else
|
else
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
_("USB device %s is already in use"),
|
_("USB device %s is already in use"),
|
||||||
usbDeviceGetName(tmp));
|
usbDeviceGetName(tmp));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -653,9 +656,9 @@ qemuPrepareHostUSBDevices(struct qemud_driver *driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (usbDeviceListCount(devs) > 1) {
|
if (usbDeviceListCount(devs) > 1) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("multiple USB devices for %x:%x, "
|
_("multiple USB devices for %x:%x, "
|
||||||
"use <address> to specify one"), vendor, product);
|
"use <address> to specify one"), vendor, product);
|
||||||
usbDeviceListFree(devs);
|
usbDeviceListFree(devs);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
@ -66,23 +66,23 @@ int qemuDomainChangeEjectableMedia(struct qemud_driver *driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!origdisk) {
|
if (!origdisk) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("No device with bus '%s' and target '%s'"),
|
_("No device with bus '%s' and target '%s'"),
|
||||||
virDomainDiskBusTypeToString(disk->bus),
|
virDomainDiskBusTypeToString(disk->bus),
|
||||||
disk->dst);
|
disk->dst);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!origdisk->info.alias) {
|
if (!origdisk->info.alias) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("missing disk device alias name for %s"), origdisk->dst);
|
_("missing disk device alias name for %s"), origdisk->dst);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (origdisk->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY &&
|
if (origdisk->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY &&
|
||||||
origdisk->device != VIR_DOMAIN_DISK_DEVICE_CDROM) {
|
origdisk->device != VIR_DOMAIN_DISK_DEVICE_CDROM) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Removable media not supported for %s device"),
|
_("Removable media not supported for %s device"),
|
||||||
virDomainDiskDeviceTypeToString(disk->device));
|
virDomainDiskDeviceTypeToString(disk->device));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -210,8 +210,8 @@ int qemuDomainAttachPciDiskDevice(virConnectPtr conn,
|
|||||||
|
|
||||||
for (i = 0 ; i < vm->def->ndisks ; i++) {
|
for (i = 0 ; i < vm->def->ndisks ; i++) {
|
||||||
if (STREQ(vm->def->disks[i]->dst, disk->dst)) {
|
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);
|
_("target %s already exists"), disk->dst);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -318,9 +318,9 @@ int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver,
|
|||||||
for (i = 0 ; i < vm->def->ncontrollers ; i++) {
|
for (i = 0 ; i < vm->def->ncontrollers ; i++) {
|
||||||
if ((vm->def->controllers[i]->type == controller->type) &&
|
if ((vm->def->controllers[i]->type == controller->type) &&
|
||||||
(vm->def->controllers[i]->idx == controller->idx)) {
|
(vm->def->controllers[i]->idx == controller->idx)) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("target %s:%d already exists"),
|
_("target %s:%d already exists"),
|
||||||
type, controller->idx);
|
type, controller->idx);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -335,8 +335,8 @@ int qemuDomainAttachPciControllerDevice(struct qemud_driver *driver,
|
|||||||
if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
|
if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
|
||||||
controller->model == -1 &&
|
controller->model == -1 &&
|
||||||
!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) {
|
!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"));
|
_("USB controller hotplug unsupported in this QEMU binary"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -415,8 +415,8 @@ qemuDomainFindOrCreateSCSIDiskController(struct qemud_driver *driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!virDomainObjIsActive(vm)) {
|
if (!virDomainObjIsActive(vm)) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("guest unexpectedly quit"));
|
_("guest unexpectedly quit"));
|
||||||
/* cont doesn't need freeing here, since the reference
|
/* cont doesn't need freeing here, since the reference
|
||||||
* now held in def->controllers */
|
* now held in def->controllers */
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -440,8 +440,8 @@ int qemuDomainAttachSCSIDisk(virConnectPtr conn,
|
|||||||
|
|
||||||
for (i = 0 ; i < vm->def->ndisks ; i++) {
|
for (i = 0 ; i < vm->def->ndisks ; i++) {
|
||||||
if (STREQ(vm->def->disks[i]->dst, disk->dst)) {
|
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);
|
_("target %s already exists"), disk->dst);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -458,9 +458,9 @@ int qemuDomainAttachSCSIDisk(virConnectPtr conn,
|
|||||||
|
|
||||||
/* We should have an address already, so make sure */
|
/* We should have an address already, so make sure */
|
||||||
if (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) {
|
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"),
|
_("unexpected disk address type %s"),
|
||||||
virDomainDeviceAddressTypeToString(disk->info.type));
|
virDomainDeviceAddressTypeToString(disk->info.type));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -486,8 +486,8 @@ int qemuDomainAttachSCSIDisk(virConnectPtr conn,
|
|||||||
sa_assert (cont);
|
sa_assert (cont);
|
||||||
|
|
||||||
if (cont->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
|
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);
|
_("SCSI controller %d was missing its PCI address"), cont->idx);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -563,8 +563,8 @@ int qemuDomainAttachUsbMassstorageDevice(virConnectPtr conn,
|
|||||||
|
|
||||||
for (i = 0 ; i < vm->def->ndisks ; i++) {
|
for (i = 0 ; i < vm->def->ndisks ; i++) {
|
||||||
if (STREQ(vm->def->disks[i]->dst, disk->dst)) {
|
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);
|
_("target %s already exists"), disk->dst);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -581,8 +581,8 @@ int qemuDomainAttachUsbMassstorageDevice(virConnectPtr conn,
|
|||||||
|
|
||||||
/* XXX not correct once we allow attaching a USB CDROM */
|
/* XXX not correct once we allow attaching a USB CDROM */
|
||||||
if (!disk->src) {
|
if (!disk->src) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("disk source path is missing"));
|
"%s", _("disk source path is missing"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -692,8 +692,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_HOST_NET_ADD)) {
|
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"));
|
_("installed qemu version does not support host_net_add"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -734,8 +734,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
|
|||||||
vlan = qemuDomainNetVLAN(net);
|
vlan = qemuDomainNetVLAN(net);
|
||||||
|
|
||||||
if (vlan < 0) {
|
if (vlan < 0) {
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("Unable to attach network devices without vlan"));
|
_("Unable to attach network devices without vlan"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -784,8 +784,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
|
|||||||
VIR_FORCE_CLOSE(vhostfd);
|
VIR_FORCE_CLOSE(vhostfd);
|
||||||
|
|
||||||
if (!virDomainObjIsActive(vm)) {
|
if (!virDomainObjIsActive(vm)) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("guest unexpectedly quit"));
|
_("guest unexpectedly quit"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -820,8 +820,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
|
|||||||
/* set link state */
|
/* set link state */
|
||||||
if (net->linkstate == VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN) {
|
if (net->linkstate == VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN) {
|
||||||
if (!net->info.alias) {
|
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"));
|
_("device alias not found: cannot set link state to down"));
|
||||||
} else {
|
} else {
|
||||||
qemuDomainObjEnterMonitorWithDriver(driver, vm);
|
qemuDomainObjEnterMonitorWithDriver(driver, vm);
|
||||||
|
|
||||||
@ -832,8 +832,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
|
|||||||
goto try_remove;
|
goto try_remove;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("setting of link state not supported: Link is up"));
|
_("setting of link state not supported: Link is up"));
|
||||||
}
|
}
|
||||||
|
|
||||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||||
@ -953,8 +953,8 @@ int qemuDomainAttachHostPciDevice(struct qemud_driver *driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!virDomainObjIsActive(vm)) {
|
if (!virDomainObjIsActive(vm)) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("guest unexpectedly quit during hotplug"));
|
_("guest unexpectedly quit during hotplug"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1077,9 +1077,9 @@ int qemuDomainAttachHostUsbDevice(struct qemud_driver *driver,
|
|||||||
qemuCgroupData data;
|
qemuCgroupData data;
|
||||||
|
|
||||||
if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) !=0 ) {
|
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"),
|
_("Unable to find cgroup for %s"),
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1124,9 +1124,9 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver,
|
|||||||
usbDevice *usb = NULL;
|
usbDevice *usb = NULL;
|
||||||
|
|
||||||
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
|
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("hostdev mode '%s' not supported"),
|
_("hostdev mode '%s' not supported"),
|
||||||
virDomainHostdevModeTypeToString(hostdev->mode));
|
virDomainHostdevModeTypeToString(hostdev->mode));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1148,9 +1148,9 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (usbDeviceListCount(devs) > 1) {
|
if (usbDeviceListCount(devs) > 1) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("multiple USB devices for %x:%x, "
|
_("multiple USB devices for %x:%x, "
|
||||||
"use <address> to specify one"), vendor, product);
|
"use <address> to specify one"), vendor, product);
|
||||||
usbDeviceListFree(devs);
|
usbDeviceListFree(devs);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -1199,9 +1199,9 @@ int qemuDomainAttachHostDevice(struct qemud_driver *driver,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("hostdev subsys type '%s' not supported"),
|
_("hostdev subsys type '%s' not supported"),
|
||||||
virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type));
|
virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1246,8 +1246,8 @@ int qemuDomainChangeNetBridge(virDomainObjPtr vm,
|
|||||||
olddev->ifname, oldbridge, newbridge);
|
olddev->ifname, oldbridge, newbridge);
|
||||||
|
|
||||||
if (virNetDevExists(newbridge) != 1) {
|
if (virNetDevExists(newbridge) != 1) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("bridge %s doesn't exist"), newbridge);
|
_("bridge %s doesn't exist"), newbridge);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1268,9 +1268,9 @@ int qemuDomainChangeNetBridge(virDomainObjPtr vm,
|
|||||||
ret = virNetDevBridgeAddPort(oldbridge, olddev->ifname);
|
ret = virNetDevBridgeAddPort(oldbridge, olddev->ifname);
|
||||||
virDomainAuditNet(vm, NULL, olddev, "attach", ret == 0);
|
virDomainAuditNet(vm, NULL, olddev, "attach", ret == 0);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("unable to recover former state by adding port"
|
_("unable to recover former state by adding port"
|
||||||
"to bridge %s"), oldbridge);
|
"to bridge %s"), oldbridge);
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1291,8 +1291,8 @@ int qemuDomainChangeNetLinkState(struct qemud_driver *driver,
|
|||||||
VIR_DEBUG("dev: %s, state: %d", dev->info.alias, linkstate);
|
VIR_DEBUG("dev: %s, state: %d", dev->info.alias, linkstate);
|
||||||
|
|
||||||
if (!dev->info.alias) {
|
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"));
|
_("can't change link state: device alias not found"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1321,14 +1321,14 @@ int qemuDomainChangeNet(struct qemud_driver *driver,
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!olddev) {
|
if (!olddev) {
|
||||||
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
|
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||||
_("cannot find existing network device to modify"));
|
_("cannot find existing network device to modify"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (olddev->type != dev->type) {
|
if (olddev->type != dev->type) {
|
||||||
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
|
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||||
_("cannot change network interface type"));
|
_("cannot change network interface type"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1340,8 +1340,8 @@ int qemuDomainChangeNet(struct qemud_driver *driver,
|
|||||||
if (STRNEQ_NULLABLE(olddev->data.ethernet.dev, dev->data.ethernet.dev) ||
|
if (STRNEQ_NULLABLE(olddev->data.ethernet.dev, dev->data.ethernet.dev) ||
|
||||||
STRNEQ_NULLABLE(olddev->script, dev->script) ||
|
STRNEQ_NULLABLE(olddev->script, dev->script) ||
|
||||||
STRNEQ_NULLABLE(olddev->data.ethernet.ipaddr, dev->data.ethernet.ipaddr)) {
|
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"));
|
_("cannot modify ethernet network device configuration"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1351,8 +1351,8 @@ int qemuDomainChangeNet(struct qemud_driver *driver,
|
|||||||
case VIR_DOMAIN_NET_TYPE_MCAST:
|
case VIR_DOMAIN_NET_TYPE_MCAST:
|
||||||
if (STRNEQ_NULLABLE(olddev->data.socket.address, dev->data.socket.address) ||
|
if (STRNEQ_NULLABLE(olddev->data.socket.address, dev->data.socket.address) ||
|
||||||
olddev->data.socket.port != dev->data.socket.port) {
|
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"));
|
_("cannot modify network socket device configuration"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1361,8 +1361,8 @@ int qemuDomainChangeNet(struct qemud_driver *driver,
|
|||||||
if (STRNEQ_NULLABLE(olddev->data.network.name, dev->data.network.name) ||
|
if (STRNEQ_NULLABLE(olddev->data.network.name, dev->data.network.name) ||
|
||||||
STRNEQ_NULLABLE(olddev->data.network.portgroup, dev->data.network.portgroup) ||
|
STRNEQ_NULLABLE(olddev->data.network.portgroup, dev->data.network.portgroup) ||
|
||||||
!virNetDevVPortProfileEqual(olddev->data.network.virtPortProfile, dev->data.network.virtPortProfile)) {
|
!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"));
|
_("cannot modify network device configuration"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1372,16 +1372,16 @@ int qemuDomainChangeNet(struct qemud_driver *driver,
|
|||||||
/* allow changing brname, but not portprofile */
|
/* allow changing brname, but not portprofile */
|
||||||
if (!virNetDevVPortProfileEqual(olddev->data.bridge.virtPortProfile,
|
if (!virNetDevVPortProfileEqual(olddev->data.bridge.virtPortProfile,
|
||||||
dev->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"));
|
_("cannot modify bridge network device configuration"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_NET_TYPE_INTERNAL:
|
case VIR_DOMAIN_NET_TYPE_INTERNAL:
|
||||||
if (STRNEQ_NULLABLE(olddev->data.internal.name, dev->data.internal.name)) {
|
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"));
|
_("cannot modify internal network device configuration"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1390,16 +1390,16 @@ int qemuDomainChangeNet(struct qemud_driver *driver,
|
|||||||
if (STRNEQ_NULLABLE(olddev->data.direct.linkdev, dev->data.direct.linkdev) ||
|
if (STRNEQ_NULLABLE(olddev->data.direct.linkdev, dev->data.direct.linkdev) ||
|
||||||
olddev->data.direct.mode != dev->data.direct.mode ||
|
olddev->data.direct.mode != dev->data.direct.mode ||
|
||||||
!virNetDevVPortProfileEqual(olddev->data.direct.virtPortProfile, dev->data.direct.virtPortProfile)) {
|
!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"));
|
_("cannot modify direct network device configuration"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unable to change config on '%s' network type"),
|
_("unable to change config on '%s' network type"),
|
||||||
virDomainNetTypeToString(dev->type));
|
virDomainNetTypeToString(dev->type));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1407,16 +1407,16 @@ int qemuDomainChangeNet(struct qemud_driver *driver,
|
|||||||
/* all other unmodifiable parameters */
|
/* all other unmodifiable parameters */
|
||||||
if (STRNEQ_NULLABLE(olddev->model, dev->model) ||
|
if (STRNEQ_NULLABLE(olddev->model, dev->model) ||
|
||||||
STRNEQ_NULLABLE(olddev->filter, dev->filter)) {
|
STRNEQ_NULLABLE(olddev->filter, dev->filter)) {
|
||||||
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
|
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||||
_("cannot modify network device configuration"));
|
_("cannot modify network device configuration"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if device name has been set, if no, retain the autogenerated one */
|
/* check if device name has been set, if no, retain the autogenerated one */
|
||||||
if (dev->ifname &&
|
if (dev->ifname &&
|
||||||
STRNEQ_NULLABLE(olddev->ifname, 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"));
|
_("cannot modify network device configuration"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1462,8 +1462,8 @@ qemuDomainChangeGraphics(struct qemud_driver *driver,
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (!olddev) {
|
if (!olddev) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("cannot find existing graphics device to modify"));
|
_("cannot find existing graphics device to modify"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1477,23 +1477,23 @@ qemuDomainChangeGraphics(struct qemud_driver *driver,
|
|||||||
if ((olddev->data.vnc.autoport != dev->data.vnc.autoport) ||
|
if ((olddev->data.vnc.autoport != dev->data.vnc.autoport) ||
|
||||||
(!dev->data.vnc.autoport &&
|
(!dev->data.vnc.autoport &&
|
||||||
(olddev->data.vnc.port != dev->data.vnc.port))) {
|
(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"));
|
_("cannot change port settings on vnc graphics"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (STRNEQ_NULLABLE(oldListenAddr,newListenAddr)) {
|
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"));
|
_("cannot change listen address setting on vnc graphics"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (STRNEQ_NULLABLE(oldListenNetwork,newListenNetwork)) {
|
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"));
|
_("cannot change listen network setting on vnc graphics"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (STRNEQ_NULLABLE(olddev->data.vnc.keymap, dev->data.vnc.keymap)) {
|
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"));
|
_("cannot change keymap setting on vnc graphics"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1530,23 +1530,23 @@ qemuDomainChangeGraphics(struct qemud_driver *driver,
|
|||||||
(olddev->data.spice.port != dev->data.spice.port)) ||
|
(olddev->data.spice.port != dev->data.spice.port)) ||
|
||||||
(!dev->data.spice.autoport &&
|
(!dev->data.spice.autoport &&
|
||||||
(olddev->data.spice.tlsPort != dev->data.spice.tlsPort))) {
|
(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"));
|
_("cannot change port settings on spice graphics"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (STRNEQ_NULLABLE(oldListenAddr, newListenAddr)) {
|
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"));
|
_("cannot change listen address setting on spice graphics"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (STRNEQ_NULLABLE(oldListenNetwork, newListenNetwork)) {
|
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"));
|
_("cannot change listen network setting on spice graphics"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (STRNEQ_NULLABLE(olddev->data.spice.keymap,
|
if (STRNEQ_NULLABLE(olddev->data.spice.keymap,
|
||||||
dev->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"));
|
_("cannot change keymap setting on spice graphics"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1584,9 +1584,9 @@ qemuDomainChangeGraphics(struct qemud_driver *driver,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unable to change config on '%s' graphics type"),
|
_("unable to change config on '%s' graphics type"),
|
||||||
virDomainGraphicsTypeToString(dev->type));
|
virDomainGraphicsTypeToString(dev->type));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1646,33 +1646,33 @@ int qemuDomainDetachPciDiskDevice(struct qemud_driver *driver,
|
|||||||
i = qemuFindDisk(vm->def, dev->data.disk->dst);
|
i = qemuFindDisk(vm->def, dev->data.disk->dst);
|
||||||
|
|
||||||
if (i < 0) {
|
if (i < 0) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("disk %s not found"), dev->data.disk->dst);
|
_("disk %s not found"), dev->data.disk->dst);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
detach = vm->def->disks[i];
|
detach = vm->def->disks[i];
|
||||||
|
|
||||||
if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
|
if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("cannot hot unplug multifunction PCI device: %s"),
|
_("cannot hot unplug multifunction PCI device: %s"),
|
||||||
dev->data.disk->dst);
|
dev->data.disk->dst);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES)) {
|
if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES)) {
|
||||||
if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) {
|
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"),
|
_("Unable to find cgroup for %s"),
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!virDomainDeviceAddressIsValid(&detach->info,
|
if (!virDomainDeviceAddressIsValid(&detach->info,
|
||||||
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
|
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"));
|
_("device cannot be detached without a PCI address"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1750,15 +1750,15 @@ int qemuDomainDetachDiskDevice(struct qemud_driver *driver,
|
|||||||
i = qemuFindDisk(vm->def, dev->data.disk->dst);
|
i = qemuFindDisk(vm->def, dev->data.disk->dst);
|
||||||
|
|
||||||
if (i < 0) {
|
if (i < 0) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("disk %s not found"), dev->data.disk->dst);
|
_("disk %s not found"), dev->data.disk->dst);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
|
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"),
|
_("Underlying qemu does not support %s disk removal"),
|
||||||
virDomainDiskBusTypeToString(dev->data.disk->bus));
|
virDomainDiskBusTypeToString(dev->data.disk->bus));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1766,9 +1766,9 @@ int qemuDomainDetachDiskDevice(struct qemud_driver *driver,
|
|||||||
|
|
||||||
if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES)) {
|
if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_DEVICES)) {
|
||||||
if (virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0) != 0) {
|
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"),
|
_("Unable to find cgroup for %s"),
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1887,30 +1887,30 @@ int qemuDomainDetachPciControllerDevice(struct qemud_driver *driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!detach) {
|
if (!detach) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("disk controller %s:%d not found"),
|
_("disk controller %s:%d not found"),
|
||||||
virDomainControllerTypeToString(dev->data.controller->type),
|
virDomainControllerTypeToString(dev->data.controller->type),
|
||||||
dev->data.controller->idx);
|
dev->data.controller->idx);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!virDomainDeviceAddressIsValid(&detach->info,
|
if (!virDomainDeviceAddressIsValid(&detach->info,
|
||||||
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
|
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"));
|
_("device cannot be detached without a PCI address"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
|
if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("cannot hot unplug multifunction PCI device: %s"),
|
_("cannot hot unplug multifunction PCI device: %s"),
|
||||||
dev->data.disk->dst);
|
dev->data.disk->dst);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemuDomainControllerIsBusy(vm, detach)) {
|
if (qemuDomainControllerIsBusy(vm, detach)) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||||
_("device cannot be detached: device is busy"));
|
_("device cannot be detached: device is busy"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1973,17 +1973,17 @@ qemuDomainDetachHostPciDevice(struct qemud_driver *driver,
|
|||||||
pciDevice *activePci;
|
pciDevice *activePci;
|
||||||
|
|
||||||
if (qemuIsMultiFunctionDevice(vm->def, detach->info)) {
|
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"),
|
_("cannot hot unplug multifunction PCI device: %.4x:%.2x:%.2x.%.1x"),
|
||||||
subsys->u.pci.domain, subsys->u.pci.bus,
|
subsys->u.pci.domain, subsys->u.pci.bus,
|
||||||
subsys->u.pci.slot, subsys->u.pci.function);
|
subsys->u.pci.slot, subsys->u.pci.function);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!virDomainDeviceAddressIsValid(detach->info,
|
if (!virDomainDeviceAddressIsValid(detach->info,
|
||||||
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
|
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"));
|
"%s", _("device cannot be detached without a PCI address"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2042,14 +2042,14 @@ qemuDomainDetachHostUsbDevice(struct qemud_driver *driver,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!detach->info->alias) {
|
if (!detach->info->alias) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
"%s", _("device cannot be detached without a device alias"));
|
"%s", _("device cannot be detached without a device alias"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
|
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"));
|
"%s", _("device cannot be detached with this QEMU version"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2088,9 +2088,9 @@ int qemuDomainDetachThisHostDevice(struct qemud_driver *driver,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (idx >= vm->def->nhostdevs) {
|
if (idx >= vm->def->nhostdevs) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("device not found in hostdevs list (%d entries)"),
|
_("device not found in hostdevs list (%d entries)"),
|
||||||
vm->def->nhostdevs);
|
vm->def->nhostdevs);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2103,9 +2103,9 @@ int qemuDomainDetachThisHostDevice(struct qemud_driver *driver,
|
|||||||
ret = qemuDomainDetachHostUsbDevice(driver, vm, detach);
|
ret = qemuDomainDetachHostUsbDevice(driver, vm, detach);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("hostdev subsys type '%s' not supported"),
|
_("hostdev subsys type '%s' not supported"),
|
||||||
virDomainHostdevSubsysTypeToString(detach->source.subsys.type));
|
virDomainHostdevSubsysTypeToString(detach->source.subsys.type));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2131,9 +2131,9 @@ int qemuDomainDetachHostDevice(struct qemud_driver *driver,
|
|||||||
int idx;
|
int idx;
|
||||||
|
|
||||||
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
|
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("hostdev mode '%s' not supported"),
|
_("hostdev mode '%s' not supported"),
|
||||||
virDomainHostdevModeTypeToString(hostdev->mode));
|
virDomainHostdevModeTypeToString(hostdev->mode));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2142,25 +2142,25 @@ int qemuDomainDetachHostDevice(struct qemud_driver *driver,
|
|||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
switch(subsys->type) {
|
switch(subsys->type) {
|
||||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
|
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"),
|
_("host pci device %.4x:%.2x:%.2x.%.1x not found"),
|
||||||
subsys->u.pci.domain, subsys->u.pci.bus,
|
subsys->u.pci.domain, subsys->u.pci.bus,
|
||||||
subsys->u.pci.slot, subsys->u.pci.function);
|
subsys->u.pci.slot, subsys->u.pci.function);
|
||||||
break;
|
break;
|
||||||
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
|
||||||
if (subsys->u.usb.bus && subsys->u.usb.device) {
|
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"),
|
_("host usb device %03d.%03d not found"),
|
||||||
subsys->u.usb.bus, subsys->u.usb.device);
|
subsys->u.usb.bus, subsys->u.usb.device);
|
||||||
} else {
|
} else {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("host usb device vendor=0x%.4x product=0x%.4x not found"),
|
_("host usb device vendor=0x%.4x product=0x%.4x not found"),
|
||||||
subsys->u.usb.vendor, subsys->u.usb.product);
|
subsys->u.usb.vendor, subsys->u.usb.product);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unexpected hostdev type %d"), subsys->type);
|
_("unexpected hostdev type %d"), subsys->type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
@ -2197,11 +2197,11 @@ qemuDomainDetachNetDevice(struct qemud_driver *driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!detach) {
|
if (!detach) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("network device %02x:%02x:%02x:%02x:%02x:%02x not found"),
|
_("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[0], dev->data.net->mac.addr[1],
|
||||||
dev->data.net->mac.addr[2], dev->data.net->mac.addr[3],
|
dev->data.net->mac.addr[2], dev->data.net->mac.addr[3],
|
||||||
dev->data.net->mac.addr[4], dev->data.net->mac.addr[5]);
|
dev->data.net->mac.addr[4], dev->data.net->mac.addr[5]);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2214,21 +2214,21 @@ qemuDomainDetachNetDevice(struct qemud_driver *driver,
|
|||||||
|
|
||||||
if (!virDomainDeviceAddressIsValid(&detach->info,
|
if (!virDomainDeviceAddressIsValid(&detach->info,
|
||||||
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
|
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"));
|
"%s", _("device cannot be detached without a PCI address"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
|
if (qemuIsMultiFunctionDevice(vm->def, &detach->info)) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("cannot hot unplug multifunction PCI device :%s"),
|
_("cannot hot unplug multifunction PCI device :%s"),
|
||||||
dev->data.disk->dst);
|
dev->data.disk->dst);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((vlan = qemuDomainNetVLAN(detach)) < 0) {
|
if ((vlan = qemuDomainNetVLAN(detach)) < 0) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
"%s", _("unable to determine original VLAN"));
|
"%s", _("unable to determine original VLAN"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2341,8 +2341,8 @@ qemuDomainChangeGraphicsPasswords(struct qemud_driver *driver,
|
|||||||
|
|
||||||
if (ret == -2) {
|
if (ret == -2) {
|
||||||
if (type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
|
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"));
|
_("Graphics password only supported for VNC"));
|
||||||
ret = -1;
|
ret = -1;
|
||||||
} else {
|
} else {
|
||||||
ret = qemuMonitorSetVNCPassword(priv->mon,
|
ret = qemuMonitorSetVNCPassword(priv->mon,
|
||||||
@ -2367,8 +2367,8 @@ qemuDomainChangeGraphicsPasswords(struct qemud_driver *driver,
|
|||||||
if (ret == -2) {
|
if (ret == -2) {
|
||||||
/* XXX we could fake this with a timer */
|
/* XXX we could fake this with a timer */
|
||||||
if (auth->expires) {
|
if (auth->expires) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Expiry of passwords is not supported"));
|
_("Expiry of passwords is not supported"));
|
||||||
ret = -1;
|
ret = -1;
|
||||||
} else {
|
} else {
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@ -2405,9 +2405,9 @@ int qemuDomainDetachLease(struct qemud_driver *driver,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
if ((i = virDomainLeaseIndex(vm->def, lease)) < 0) {
|
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 %s in lockspace %s does not exist"),
|
||||||
lease->key, NULLSTR(lease->lockspace));
|
lease->key, NULLSTR(lease->lockspace));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,16 +164,16 @@ qemuDomainExtractTLSSubject(const char *certdir)
|
|||||||
goto no_memory;
|
goto no_memory;
|
||||||
|
|
||||||
if (virFileReadAll(certfile, 8192, &pemdata) < 0) {
|
if (virFileReadAll(certfile, 8192, &pemdata) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unable to read server cert %s"), certfile);
|
_("unable to read server cert %s"), certfile);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = gnutls_x509_crt_init(&cert);
|
ret = gnutls_x509_crt_init(&cert);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot initialize cert object: %s"),
|
_("cannot initialize cert object: %s"),
|
||||||
gnutls_strerror(ret));
|
gnutls_strerror(ret));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,9 +182,9 @@ qemuDomainExtractTLSSubject(const char *certdir)
|
|||||||
|
|
||||||
ret = gnutls_x509_crt_import(cert, &pemdatum, GNUTLS_X509_FMT_PEM);
|
ret = gnutls_x509_crt_import(cert, &pemdatum, GNUTLS_X509_FMT_PEM);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot load cert data from %s: %s"),
|
_("cannot load cert data from %s: %s"),
|
||||||
certfile, gnutls_strerror(ret));
|
certfile, gnutls_strerror(ret));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,8 +277,8 @@ qemuMigrationCookieNew(virDomainObjPtr dom)
|
|||||||
if (!(mig->localHostname = virGetHostname(NULL)))
|
if (!(mig->localHostname = virGetHostname(NULL)))
|
||||||
goto error;
|
goto error;
|
||||||
if (virGetHostUUID(mig->localHostuuid) < 0) {
|
if (virGetHostUUID(mig->localHostuuid) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Unable to obtain host UUID"));
|
_("Unable to obtain host UUID"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,8 +298,8 @@ qemuMigrationCookieAddGraphics(qemuMigrationCookiePtr mig,
|
|||||||
virDomainObjPtr dom)
|
virDomainObjPtr dom)
|
||||||
{
|
{
|
||||||
if (mig->flags & QEMU_MIGRATION_COOKIE_GRAPHICS) {
|
if (mig->flags & QEMU_MIGRATION_COOKIE_GRAPHICS) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Migration graphics data already present"));
|
_("Migration graphics data already present"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,8 +324,8 @@ qemuMigrationCookieAddLockstate(qemuMigrationCookiePtr mig,
|
|||||||
qemuDomainObjPrivatePtr priv = dom->privateData;
|
qemuDomainObjPrivatePtr priv = dom->privateData;
|
||||||
|
|
||||||
if (mig->flags & QEMU_MIGRATION_COOKIE_LOCKSTATE) {
|
if (mig->flags & QEMU_MIGRATION_COOKIE_LOCKSTATE) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Migration lockstate data already present"));
|
_("Migration lockstate data already present"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -355,8 +355,8 @@ qemuMigrationCookieAddPersistent(qemuMigrationCookiePtr mig,
|
|||||||
virDomainObjPtr dom)
|
virDomainObjPtr dom)
|
||||||
{
|
{
|
||||||
if (mig->flags & QEMU_MIGRATION_COOKIE_PERSISTENT) {
|
if (mig->flags & QEMU_MIGRATION_COOKIE_PERSISTENT) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Migration persistent data already present"));
|
_("Migration persistent data already present"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,32 +474,32 @@ qemuMigrationCookieGraphicsXMLParse(xmlXPathContextPtr ctxt)
|
|||||||
goto no_memory;
|
goto no_memory;
|
||||||
|
|
||||||
if (!(tmp = virXPathString("string(./graphics/@type)", ctxt))) {
|
if (!(tmp = virXPathString("string(./graphics/@type)", ctxt))) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("missing type attribute in migration data"));
|
"%s", _("missing type attribute in migration data"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if ((grap->type = virDomainGraphicsTypeFromString(tmp)) < 0) {
|
if ((grap->type = virDomainGraphicsTypeFromString(tmp)) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unknown graphics type %s"), tmp);
|
_("unknown graphics type %s"), tmp);
|
||||||
VIR_FREE(tmp);
|
VIR_FREE(tmp);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
VIR_FREE(tmp);
|
VIR_FREE(tmp);
|
||||||
if (virXPathInt("string(./graphics/@port)", ctxt, &grap->port) < 0) {
|
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"));
|
"%s", _("missing port attribute in migration data"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (grap->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
|
if (grap->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
|
||||||
if (virXPathInt("string(./graphics/@tlsPort)", ctxt, &grap->tlsPort) < 0) {
|
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"));
|
"%s", _("missing tlsPort attribute in migration data"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!(grap->listen = virXPathString("string(./graphics/@listen)", ctxt))) {
|
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"));
|
"%s", _("missing listen attribute in migration data"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
/* Optional */
|
/* Optional */
|
||||||
@ -535,14 +535,14 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
|
|||||||
|
|
||||||
/* Extract domain name */
|
/* Extract domain name */
|
||||||
if (!(tmp = virXPathString("string(./name[1])", ctxt))) {
|
if (!(tmp = virXPathString("string(./name[1])", ctxt))) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("missing name element in migration data"));
|
"%s", _("missing name element in migration data"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (STRNEQ(tmp, mig->name)) {
|
if (STRNEQ(tmp, mig->name)) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Incoming cookie data had unexpected name %s vs %s"),
|
_("Incoming cookie data had unexpected name %s vs %s"),
|
||||||
tmp, mig->name);
|
tmp, mig->name);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
VIR_FREE(tmp);
|
VIR_FREE(tmp);
|
||||||
@ -550,45 +550,45 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
|
|||||||
/* Extract domain uuid */
|
/* Extract domain uuid */
|
||||||
tmp = virXPathString("string(./uuid[1])", ctxt);
|
tmp = virXPathString("string(./uuid[1])", ctxt);
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("missing uuid element in migration data"));
|
"%s", _("missing uuid element in migration data"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
virUUIDFormat(mig->uuid, uuidstr);
|
virUUIDFormat(mig->uuid, uuidstr);
|
||||||
if (STRNEQ(tmp, uuidstr)) {
|
if (STRNEQ(tmp, uuidstr)) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Incoming cookie data had unexpected UUID %s vs %s"),
|
_("Incoming cookie data had unexpected UUID %s vs %s"),
|
||||||
tmp, uuidstr);
|
tmp, uuidstr);
|
||||||
}
|
}
|
||||||
VIR_FREE(tmp);
|
VIR_FREE(tmp);
|
||||||
|
|
||||||
/* Check & forbid "localhost" migration */
|
/* Check & forbid "localhost" migration */
|
||||||
if (!(mig->remoteHostname = virXPathString("string(./hostname[1])", ctxt))) {
|
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"));
|
"%s", _("missing hostname element in migration data"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (STREQ(mig->remoteHostname, mig->localHostname)) {
|
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"),
|
_("Attempt to migrate guest to the same host %s"),
|
||||||
mig->remoteHostname);
|
mig->remoteHostname);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(tmp = virXPathString("string(./hostuuid[1])", ctxt))) {
|
if (!(tmp = virXPathString("string(./hostuuid[1])", ctxt))) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("missing hostuuid element in migration data"));
|
"%s", _("missing hostuuid element in migration data"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (virUUIDParse(tmp, mig->remoteHostuuid) < 0) {
|
if (virUUIDParse(tmp, mig->remoteHostuuid) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("malformed hostuuid element in migration data"));
|
"%s", _("malformed hostuuid element in migration data"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (memcmp(mig->remoteHostuuid, mig->localHostuuid, VIR_UUID_BUFLEN) == 0) {
|
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"),
|
_("Attempt to migrate guest to the same host %s"),
|
||||||
tmp);
|
tmp);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
VIR_FREE(tmp);
|
VIR_FREE(tmp);
|
||||||
@ -602,23 +602,23 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
|
|||||||
int val;
|
int val;
|
||||||
char *str = virXMLPropString(nodes[i], "name");
|
char *str = virXMLPropString(nodes[i], "name");
|
||||||
if (!str) {
|
if (!str) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("missing feature name"));
|
"%s", _("missing feature name"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((val = qemuMigrationCookieFlagTypeFromString(str)) < 0) {
|
if ((val = qemuMigrationCookieFlagTypeFromString(str)) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unknown migration cookie feature %s"),
|
_("Unknown migration cookie feature %s"),
|
||||||
str);
|
str);
|
||||||
VIR_FREE(str);
|
VIR_FREE(str);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flags & (1 << val)) == 0) {
|
if ((flags & (1 << val)) == 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unsupported migration cookie feature %s"),
|
_("Unsupported migration cookie feature %s"),
|
||||||
str);
|
str);
|
||||||
VIR_FREE(str);
|
VIR_FREE(str);
|
||||||
}
|
}
|
||||||
VIR_FREE(str);
|
VIR_FREE(str);
|
||||||
@ -634,8 +634,8 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
|
|||||||
virXPathBoolean("count(./lockstate) > 0", ctxt)) {
|
virXPathBoolean("count(./lockstate) > 0", ctxt)) {
|
||||||
mig->lockDriver = virXPathString("string(./lockstate[1]/@driver)", ctxt);
|
mig->lockDriver = virXPathString("string(./lockstate[1]/@driver)", ctxt);
|
||||||
if (!mig->lockDriver) {
|
if (!mig->lockDriver) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Missing lock driver name in migration cookie"));
|
_("Missing lock driver name in migration cookie"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
mig->lockState = virXPathString("string(./lockstate[1]/leases[1])", ctxt);
|
mig->lockState = virXPathString("string(./lockstate[1]/leases[1])", ctxt);
|
||||||
@ -646,10 +646,10 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
|
|||||||
if ((flags & QEMU_MIGRATION_COOKIE_PERSISTENT) &&
|
if ((flags & QEMU_MIGRATION_COOKIE_PERSISTENT) &&
|
||||||
virXPathBoolean("count(./domain) > 0", ctxt)) {
|
virXPathBoolean("count(./domain) > 0", ctxt)) {
|
||||||
if ((n = virXPathNodeSet("./domain", ctxt, &nodes)) > 1) {
|
if ((n = virXPathNodeSet("./domain", ctxt, &nodes)) > 1) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Too many domain elements in "
|
_("Too many domain elements in "
|
||||||
"migration cookie: %d"),
|
"migration cookie: %d"),
|
||||||
n);
|
n);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
mig->persistent = virDomainDefParseNode(driver->caps, doc, nodes[0],
|
mig->persistent = virDomainDefParseNode(driver->caps, doc, nodes[0],
|
||||||
@ -744,8 +744,8 @@ qemuMigrationEatCookie(struct qemud_driver *driver,
|
|||||||
/* Parse & validate incoming cookie (if any) */
|
/* Parse & validate incoming cookie (if any) */
|
||||||
if (cookiein && cookieinlen &&
|
if (cookiein && cookieinlen &&
|
||||||
cookiein[cookieinlen-1] != '\0') {
|
cookiein[cookieinlen-1] != '\0') {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Migration cookie was not NULL terminated"));
|
_("Migration cookie was not NULL terminated"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -764,17 +764,17 @@ qemuMigrationEatCookie(struct qemud_driver *driver,
|
|||||||
if (mig->flags & QEMU_MIGRATION_COOKIE_LOCKSTATE) {
|
if (mig->flags & QEMU_MIGRATION_COOKIE_LOCKSTATE) {
|
||||||
if (!mig->lockDriver) {
|
if (!mig->lockDriver) {
|
||||||
if (virLockManagerPluginUsesState(driver->lockManager)) {
|
if (virLockManagerPluginUsesState(driver->lockManager)) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Missing %s lock state for migration cookie"),
|
_("Missing %s lock state for migration cookie"),
|
||||||
virLockManagerPluginGetName(driver->lockManager));
|
virLockManagerPluginGetName(driver->lockManager));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
} else if (STRNEQ(mig->lockDriver,
|
} else if (STRNEQ(mig->lockDriver,
|
||||||
virLockManagerPluginGetName(driver->lockManager))) {
|
virLockManagerPluginGetName(driver->lockManager))) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Source host lock driver %s different from target %s"),
|
_("Source host lock driver %s different from target %s"),
|
||||||
mig->lockDriver,
|
mig->lockDriver,
|
||||||
virLockManagerPluginGetName(driver->lockManager));
|
virLockManagerPluginGetName(driver->lockManager));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -803,23 +803,23 @@ qemuMigrationIsAllowed(struct qemud_driver *driver, virDomainObjPtr vm,
|
|||||||
|
|
||||||
if (vm) {
|
if (vm) {
|
||||||
if (qemuProcessAutoDestroyActive(driver, vm)) {
|
if (qemuProcessAutoDestroyActive(driver, vm)) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
"%s", _("domain is marked for auto destroy"));
|
"%s", _("domain is marked for auto destroy"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ((nsnapshots = virDomainSnapshotObjListNum(&vm->snapshots, NULL,
|
if ((nsnapshots = virDomainSnapshotObjListNum(&vm->snapshots, NULL,
|
||||||
0))) {
|
0))) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
_("cannot migrate domain with %d snapshots"),
|
_("cannot migrate domain with %d snapshots"),
|
||||||
nsnapshots);
|
nsnapshots);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
def = vm->def;
|
def = vm->def;
|
||||||
}
|
}
|
||||||
if (def->nhostdevs > 0) {
|
if (def->nhostdevs > 0) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
"%s", _("Domain with assigned host devices cannot be migrated"));
|
"%s", _("Domain with assigned host devices cannot be migrated"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -852,9 +852,9 @@ qemuMigrationIsSafe(virDomainDefPtr def)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
qemuReportError(VIR_ERR_MIGRATE_UNSAFE, "%s",
|
virReportError(VIR_ERR_MIGRATE_UNSAFE, "%s",
|
||||||
_("Migration may lead to data corruption if disks"
|
_("Migration may lead to data corruption if disks"
|
||||||
" use cache != none"));
|
" use cache != none"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -922,8 +922,8 @@ qemuMigrationUpdateJobStatus(struct qemud_driver *driver,
|
|||||||
switch (status) {
|
switch (status) {
|
||||||
case QEMU_MONITOR_MIGRATION_STATUS_INACTIVE:
|
case QEMU_MONITOR_MIGRATION_STATUS_INACTIVE:
|
||||||
priv->job.info.type = VIR_DOMAIN_JOB_NONE;
|
priv->job.info.type = VIR_DOMAIN_JOB_NONE;
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("%s: %s"), job, _("is not active"));
|
_("%s: %s"), job, _("is not active"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QEMU_MONITOR_MIGRATION_STATUS_ACTIVE:
|
case QEMU_MONITOR_MIGRATION_STATUS_ACTIVE:
|
||||||
@ -945,14 +945,14 @@ qemuMigrationUpdateJobStatus(struct qemud_driver *driver,
|
|||||||
|
|
||||||
case QEMU_MONITOR_MIGRATION_STATUS_ERROR:
|
case QEMU_MONITOR_MIGRATION_STATUS_ERROR:
|
||||||
priv->job.info.type = VIR_DOMAIN_JOB_FAILED;
|
priv->job.info.type = VIR_DOMAIN_JOB_FAILED;
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("%s: %s"), job, _("unexpectedly failed"));
|
_("%s: %s"), job, _("unexpectedly failed"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QEMU_MONITOR_MIGRATION_STATUS_CANCELLED:
|
case QEMU_MONITOR_MIGRATION_STATUS_CANCELLED:
|
||||||
priv->job.info.type = VIR_DOMAIN_JOB_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"));
|
_("%s: %s"), job, _("canceled by client"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -992,8 +992,8 @@ qemuMigrationWaitForCompletion(struct qemud_driver *driver, virDomainObjPtr vm,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (dconn && virConnectIsAlive(dconn) <= 0) {
|
if (dconn && virConnectIsAlive(dconn) <= 0) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||||
_("Lost connection to destination host"));
|
_("Lost connection to destination host"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1158,8 +1158,8 @@ char *qemuMigrationBegin(struct qemud_driver *driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (STRNEQ(def->name, vm->def->name)) {
|
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"));
|
_("target domain name doesn't match source name"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1371,8 +1371,8 @@ qemuMigrationPrepareAny(struct qemud_driver *driver,
|
|||||||
*/
|
*/
|
||||||
if (qemuMigrationJobContinue(vm) == 0) {
|
if (qemuMigrationJobContinue(vm) == 0) {
|
||||||
vm = NULL;
|
vm = NULL;
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
"%s", _("domain disappeared"));
|
"%s", _("domain disappeared"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1480,9 +1480,9 @@ qemuMigrationPrepareDirect(struct qemud_driver *driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (STRPREFIX(hostname, "localhost")) {
|
if (STRPREFIX(hostname, "localhost")) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("hostname on destination resolved to localhost,"
|
_("hostname on destination resolved to localhost,"
|
||||||
" but migration requires an FQDN"));
|
" but migration requires an FQDN"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1502,9 +1502,9 @@ qemuMigrationPrepareDirect(struct qemud_driver *driver,
|
|||||||
* characters in hostname part don't matter.
|
* characters in hostname part don't matter.
|
||||||
*/
|
*/
|
||||||
if (!STRPREFIX (uri_in, "tcp:")) {
|
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"
|
_("only tcp URIs are supported for KVM/QEMU"
|
||||||
" migrations"));
|
" migrations"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1526,8 +1526,8 @@ qemuMigrationPrepareDirect(struct qemud_driver *driver,
|
|||||||
p++; /* definitely has a ':' in it, see above */
|
p++; /* definitely has a ':' in it, see above */
|
||||||
this_port = virParseNumber (&p);
|
this_port = virParseNumber (&p);
|
||||||
if (this_port == -1 || p-uri_in != strlen (uri_in)) {
|
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'"));
|
"%s", _("URI ended with incorrect ':port'"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1850,10 +1850,10 @@ qemuMigrationRun(struct qemud_driver *driver,
|
|||||||
|
|
||||||
if (virLockManagerPluginUsesState(driver->lockManager) &&
|
if (virLockManagerPluginUsesState(driver->lockManager) &&
|
||||||
!cookieout) {
|
!cookieout) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Migration with lock driver %s requires"
|
_("Migration with lock driver %s requires"
|
||||||
" cookie support"),
|
" cookie support"),
|
||||||
virLockManagerPluginGetName(driver->lockManager));
|
virLockManagerPluginGetName(driver->lockManager));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1932,8 +1932,8 @@ qemuMigrationRun(struct qemud_driver *driver,
|
|||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
||||||
if (!virDomainObjIsActive(vm)) {
|
if (!virDomainObjIsActive(vm)) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("guest unexpectedly quit"));
|
_("guest unexpectedly quit"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2102,8 +2102,8 @@ static int doTunnelMigrate(struct qemud_driver *driver,
|
|||||||
if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_FD) &&
|
if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_FD) &&
|
||||||
!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_UNIX) &&
|
!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_UNIX) &&
|
||||||
!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATE_QEMU_EXEC)) {
|
!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"));
|
_("Source qemu is too old to support tunnelled migration"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2233,15 +2233,15 @@ static int doPeer2PeerMigrate2(struct qemud_driver *driver,
|
|||||||
* in qemuDomainObjEnterRemoteWithDriver, so check again
|
* in qemuDomainObjEnterRemoteWithDriver, so check again
|
||||||
*/
|
*/
|
||||||
if (!virDomainObjIsActive(vm)) {
|
if (!virDomainObjIsActive(vm)) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("guest unexpectedly quit"));
|
_("guest unexpectedly quit"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(flags & VIR_MIGRATE_TUNNELLED) &&
|
if (!(flags & VIR_MIGRATE_TUNNELLED) &&
|
||||||
(uri_out == NULL)) {
|
(uri_out == NULL)) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("domainMigratePrepare2 did not set uri"));
|
_("domainMigratePrepare2 did not set uri"));
|
||||||
cancelled = 1;
|
cancelled = 1;
|
||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
@ -2378,8 +2378,8 @@ static int doPeer2PeerMigrate3(struct qemud_driver *driver,
|
|||||||
|
|
||||||
if (!(flags & VIR_MIGRATE_TUNNELLED) &&
|
if (!(flags & VIR_MIGRATE_TUNNELLED) &&
|
||||||
(uri_out == NULL)) {
|
(uri_out == NULL)) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("domainMigratePrepare3 did not set uri"));
|
_("domainMigratePrepare3 did not set uri"));
|
||||||
cancelled = 1;
|
cancelled = 1;
|
||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
@ -2529,8 +2529,8 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver,
|
|||||||
dconn = virConnectOpen(dconnuri);
|
dconn = virConnectOpen(dconnuri);
|
||||||
qemuDomainObjExitRemoteWithDriver(driver, vm);
|
qemuDomainObjExitRemoteWithDriver(driver, vm);
|
||||||
if (dconn == NULL) {
|
if (dconn == NULL) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("Failed to connect to remote libvirt URI %s"), dconnuri);
|
_("Failed to connect to remote libvirt URI %s"), dconnuri);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2550,15 +2550,15 @@ static int doPeer2PeerMigrate(struct qemud_driver *driver,
|
|||||||
qemuDomainObjExitRemoteWithDriver(driver, vm);
|
qemuDomainObjExitRemoteWithDriver(driver, vm);
|
||||||
|
|
||||||
if (!p2p) {
|
if (!p2p) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||||
_("Destination libvirt does not support peer-to-peer migration protocol"));
|
_("Destination libvirt does not support peer-to-peer migration protocol"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* domain may have been stopped while we were talking to remote daemon */
|
/* domain may have been stopped while we were talking to remote daemon */
|
||||||
if (!virDomainObjIsActive(vm)) {
|
if (!virDomainObjIsActive(vm)) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("guest unexpectedly quit"));
|
_("guest unexpectedly quit"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2620,8 +2620,8 @@ qemuMigrationPerformJob(struct qemud_driver *driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!virDomainObjIsActive(vm)) {
|
if (!virDomainObjIsActive(vm)) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
"%s", _("domain is not running"));
|
"%s", _("domain is not running"));
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2816,8 +2816,8 @@ qemuMigrationPerform(struct qemud_driver *driver,
|
|||||||
|
|
||||||
if ((flags & (VIR_MIGRATE_TUNNELLED | VIR_MIGRATE_PEER2PEER))) {
|
if ((flags & (VIR_MIGRATE_TUNNELLED | VIR_MIGRATE_PEER2PEER))) {
|
||||||
if (cookieinlen) {
|
if (cookieinlen) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
"%s", _("received unexpected cookie with P2P migration"));
|
"%s", _("received unexpected cookie with P2P migration"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2827,8 +2827,8 @@ qemuMigrationPerform(struct qemud_driver *driver,
|
|||||||
v3proto);
|
v3proto);
|
||||||
} else {
|
} else {
|
||||||
if (dconnuri) {
|
if (dconnuri) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("Unexpected dconnuri parameter with non-peer2peer migration"));
|
"%s", _("Unexpected dconnuri parameter with non-peer2peer migration"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2863,9 +2863,9 @@ qemuMigrationVPAssociatePortProfiles(virDomainDefPtr def) {
|
|||||||
def->uuid,
|
def->uuid,
|
||||||
VIR_NETDEV_VPORT_PROFILE_OP_MIGRATE_IN_FINISH,
|
VIR_NETDEV_VPORT_PROFILE_OP_MIGRATE_IN_FINISH,
|
||||||
false) < 0) {
|
false) < 0) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED,
|
virReportError(VIR_ERR_OPERATION_FAILED,
|
||||||
_("Port profile Associate failed for %s"),
|
_("Port profile Associate failed for %s"),
|
||||||
net->ifname);
|
net->ifname);
|
||||||
goto err_exit;
|
goto err_exit;
|
||||||
}
|
}
|
||||||
VIR_DEBUG("Port profile Associate succeeded for %s", net->ifname);
|
VIR_DEBUG("Port profile Associate succeeded for %s", net->ifname);
|
||||||
@ -2943,8 +2943,8 @@ qemuMigrationFinish(struct qemud_driver *driver,
|
|||||||
*/
|
*/
|
||||||
if (retcode == 0) {
|
if (retcode == 0) {
|
||||||
if (!virDomainObjIsActive(vm)) {
|
if (!virDomainObjIsActive(vm)) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("guest unexpectedly quit"));
|
_("guest unexpectedly quit"));
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2990,8 +2990,8 @@ qemuMigrationFinish(struct qemud_driver *driver,
|
|||||||
vm->persistent = 0;
|
vm->persistent = 0;
|
||||||
}
|
}
|
||||||
if (!vmdef)
|
if (!vmdef)
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("can't get vmdef"));
|
_("can't get vmdef"));
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3014,8 +3014,8 @@ qemuMigrationFinish(struct qemud_driver *driver,
|
|||||||
VIR_DOMAIN_RUNNING_MIGRATED,
|
VIR_DOMAIN_RUNNING_MIGRATED,
|
||||||
QEMU_ASYNC_JOB_MIGRATION_IN) < 0) {
|
QEMU_ASYNC_JOB_MIGRATION_IN) < 0) {
|
||||||
if (virGetLastError() == NULL)
|
if (virGetLastError() == NULL)
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("resume operation failed"));
|
"%s", _("resume operation failed"));
|
||||||
/* Need to save the current error, in case shutting
|
/* Need to save the current error, in case shutting
|
||||||
* down the process overwrites it
|
* down the process overwrites it
|
||||||
*/
|
*/
|
||||||
@ -3144,8 +3144,8 @@ int qemuMigrationConfirm(struct qemud_driver *driver,
|
|||||||
VIR_DOMAIN_RUNNING_MIGRATED,
|
VIR_DOMAIN_RUNNING_MIGRATED,
|
||||||
QEMU_ASYNC_JOB_MIGRATION_OUT) < 0) {
|
QEMU_ASYNC_JOB_MIGRATION_OUT) < 0) {
|
||||||
if (virGetLastError() == NULL)
|
if (virGetLastError() == NULL)
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("resume operation failed"));
|
"%s", _("resume operation failed"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3214,9 +3214,9 @@ qemuMigrationToFile(struct qemud_driver *driver, virDomainObjPtr vm,
|
|||||||
VIR_CGROUP_CONTROLLER_DEVICES)) {
|
VIR_CGROUP_CONTROLLER_DEVICES)) {
|
||||||
if (virCgroupForDomain(driver->cgroup, vm->def->name,
|
if (virCgroupForDomain(driver->cgroup, vm->def->name,
|
||||||
&cgroup, 0) != 0) {
|
&cgroup, 0) != 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unable to find cgroup for %s"),
|
_("Unable to find cgroup for %s"),
|
||||||
vm->def->name);
|
vm->def->name);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
rc = virCgroupAllowDevicePath(cgroup, path,
|
rc = virCgroupAllowDevicePath(cgroup, path,
|
||||||
@ -3401,7 +3401,7 @@ qemuMigrationJobIsActive(virDomainObjPtr vm,
|
|||||||
else
|
else
|
||||||
msg = _("domain '%s' is not being migrated");
|
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 false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -286,8 +286,8 @@ qemuMonitorOpenUnix(const char *monitor, pid_t cpid)
|
|||||||
memset(&addr, 0, sizeof(addr));
|
memset(&addr, 0, sizeof(addr));
|
||||||
addr.sun_family = AF_UNIX;
|
addr.sun_family = AF_UNIX;
|
||||||
if (virStrcpyStatic(addr.sun_path, monitor) == NULL) {
|
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);
|
_("Monitor path %s too big for destination"), monitor);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -329,8 +329,8 @@ qemuMonitorOpenPty(const char *monitor)
|
|||||||
int monfd;
|
int monfd;
|
||||||
|
|
||||||
if ((monfd = open(monitor, O_RDWR)) < 0) {
|
if ((monfd = open(monitor, O_RDWR)) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unable to open monitor path %s"), monitor);
|
_("Unable to open monitor path %s"), monitor);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -451,8 +451,8 @@ qemuMonitorIOWrite(qemuMonitorPtr mon)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (mon->msg->txFD != -1 && !mon->hasSendFD) {
|
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"));
|
_("Monitor does not support sending of file descriptors"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -577,9 +577,9 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) {
|
|||||||
if (mon->fd != fd || mon->watch != watch) {
|
if (mon->fd != fd || mon->watch != watch) {
|
||||||
if (events & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR))
|
if (events & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR))
|
||||||
eof = true;
|
eof = true;
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("event from unexpected fd %d!=%d / watch %d!=%d"),
|
_("event from unexpected fd %d!=%d / watch %d!=%d"),
|
||||||
mon->fd, fd, mon->watch, watch);
|
mon->fd, fd, mon->watch, watch);
|
||||||
error = true;
|
error = true;
|
||||||
} else if (mon->lastError.code != VIR_ERR_OK) {
|
} else if (mon->lastError.code != VIR_ERR_OK) {
|
||||||
if (events & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR))
|
if (events & (VIR_EVENT_HANDLE_HANGUP | VIR_EVENT_HANDLE_ERROR))
|
||||||
@ -612,23 +612,23 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) {
|
|||||||
|
|
||||||
if (!error &&
|
if (!error &&
|
||||||
events & VIR_EVENT_HANDLE_HANGUP) {
|
events & VIR_EVENT_HANDLE_HANGUP) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("End of file from monitor"));
|
_("End of file from monitor"));
|
||||||
eof = 1;
|
eof = 1;
|
||||||
events &= ~VIR_EVENT_HANDLE_HANGUP;
|
events &= ~VIR_EVENT_HANDLE_HANGUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!error && !eof &&
|
if (!error && !eof &&
|
||||||
events & VIR_EVENT_HANDLE_ERROR) {
|
events & VIR_EVENT_HANDLE_ERROR) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Invalid file descriptor while waiting for monitor"));
|
_("Invalid file descriptor while waiting for monitor"));
|
||||||
eof = 1;
|
eof = 1;
|
||||||
events &= ~VIR_EVENT_HANDLE_ERROR;
|
events &= ~VIR_EVENT_HANDLE_ERROR;
|
||||||
}
|
}
|
||||||
if (!error && events) {
|
if (!error && events) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unhandled event %d for monitor fd %d"),
|
_("Unhandled event %d for monitor fd %d"),
|
||||||
events, mon->fd);
|
events, mon->fd);
|
||||||
error = 1;
|
error = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -640,8 +640,8 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) {
|
|||||||
} else {
|
} else {
|
||||||
virErrorPtr err = virGetLastError();
|
virErrorPtr err = virGetLastError();
|
||||||
if (!err)
|
if (!err)
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Error while processing monitor IO"));
|
_("Error while processing monitor IO"));
|
||||||
virCopyLastError(&mon->lastError);
|
virCopyLastError(&mon->lastError);
|
||||||
virResetLastError();
|
virResetLastError();
|
||||||
}
|
}
|
||||||
@ -698,8 +698,8 @@ qemuMonitorOpen(virDomainObjPtr vm,
|
|||||||
qemuMonitorPtr mon;
|
qemuMonitorPtr mon;
|
||||||
|
|
||||||
if (!cb || !cb->eofNotify) {
|
if (!cb || !cb->eofNotify) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("EOF notify callback must be supplied"));
|
_("EOF notify callback must be supplied"));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -709,14 +709,14 @@ qemuMonitorOpen(virDomainObjPtr vm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virMutexInit(&mon->lock) < 0) {
|
if (virMutexInit(&mon->lock) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("cannot initialize monitor mutex"));
|
_("cannot initialize monitor mutex"));
|
||||||
VIR_FREE(mon);
|
VIR_FREE(mon);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (virCondInit(&mon->notify) < 0) {
|
if (virCondInit(&mon->notify) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("cannot initialize monitor condition"));
|
_("cannot initialize monitor condition"));
|
||||||
virMutexDestroy(&mon->lock);
|
virMutexDestroy(&mon->lock);
|
||||||
VIR_FREE(mon);
|
VIR_FREE(mon);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -739,22 +739,22 @@ qemuMonitorOpen(virDomainObjPtr vm,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unable to handle monitor type: %s"),
|
_("unable to handle monitor type: %s"),
|
||||||
virDomainChrTypeToString(config->type));
|
virDomainChrTypeToString(config->type));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mon->fd == -1) goto cleanup;
|
if (mon->fd == -1) goto cleanup;
|
||||||
|
|
||||||
if (virSetCloseExec(mon->fd) < 0) {
|
if (virSetCloseExec(mon->fd) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("Unable to set monitor close-on-exec flag"));
|
"%s", _("Unable to set monitor close-on-exec flag"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (virSetNonBlock(mon->fd) < 0) {
|
if (virSetNonBlock(mon->fd) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("Unable to put monitor into non-blocking mode"));
|
"%s", _("Unable to put monitor into non-blocking mode"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -765,8 +765,8 @@ qemuMonitorOpen(virDomainObjPtr vm,
|
|||||||
VIR_EVENT_HANDLE_READABLE,
|
VIR_EVENT_HANDLE_READABLE,
|
||||||
qemuMonitorIO,
|
qemuMonitorIO,
|
||||||
mon, qemuMonitorUnwatch)) < 0) {
|
mon, qemuMonitorUnwatch)) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("unable to register monitor events"));
|
_("unable to register monitor events"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
qemuMonitorRef(mon);
|
qemuMonitorRef(mon);
|
||||||
@ -813,8 +813,8 @@ void qemuMonitorClose(qemuMonitorPtr mon)
|
|||||||
if (mon->lastError.code == VIR_ERR_OK) {
|
if (mon->lastError.code == VIR_ERR_OK) {
|
||||||
virErrorPtr err = virSaveLastError();
|
virErrorPtr err = virSaveLastError();
|
||||||
|
|
||||||
qemuReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||||
_("Qemu monitor was closed"));
|
_("Qemu monitor was closed"));
|
||||||
virCopyLastError(&mon->lastError);
|
virCopyLastError(&mon->lastError);
|
||||||
if (err) {
|
if (err) {
|
||||||
virSetError(err);
|
virSetError(err);
|
||||||
@ -866,8 +866,8 @@ int qemuMonitorSend(qemuMonitorPtr mon,
|
|||||||
|
|
||||||
while (!mon->msg->finished) {
|
while (!mon->msg->finished) {
|
||||||
if (virCondWait(&mon->notify, &mon->lock) < 0) {
|
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"));
|
_("Unable to wait on monitor condition"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -902,8 +902,8 @@ int qemuMonitorHMPCommandWithFd(qemuMonitorPtr mon,
|
|||||||
json_cmd = qemuMonitorUnescapeArg(cmd);
|
json_cmd = qemuMonitorUnescapeArg(cmd);
|
||||||
if (!json_cmd) {
|
if (!json_cmd) {
|
||||||
VIR_DEBUG("Could not unescape command: %s", 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"));
|
_("Unable to unescape command"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
ret = qemuMonitorJSONHumanCommandWithFd(mon, json_cmd, scm_fd, reply);
|
ret = qemuMonitorJSONHumanCommandWithFd(mon, json_cmd, scm_fd, reply);
|
||||||
@ -1105,8 +1105,8 @@ int qemuMonitorSetCapabilities(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p", mon);
|
VIR_DEBUG("mon=%p", mon);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1155,8 +1155,8 @@ qemuMonitorStartCPUs(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p", mon);
|
VIR_DEBUG("mon=%p", mon);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1175,8 +1175,8 @@ qemuMonitorStopCPUs(qemuMonitorPtr mon)
|
|||||||
VIR_DEBUG("mon=%p", mon);
|
VIR_DEBUG("mon=%p", mon);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1197,8 +1197,8 @@ qemuMonitorGetStatus(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p, running=%p, reason=%p", mon, running, reason);
|
VIR_DEBUG("mon=%p, running=%p, reason=%p", mon, running, reason);
|
||||||
|
|
||||||
if (!mon || !running) {
|
if (!mon || !running) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("both monitor and running must not be NULL"));
|
_("both monitor and running must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1216,8 +1216,8 @@ int qemuMonitorSystemPowerdown(qemuMonitorPtr mon)
|
|||||||
VIR_DEBUG("mon=%p", mon);
|
VIR_DEBUG("mon=%p", mon);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1235,8 +1235,8 @@ int qemuMonitorSystemReset(qemuMonitorPtr mon)
|
|||||||
VIR_DEBUG("mon=%p", mon);
|
VIR_DEBUG("mon=%p", mon);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1255,8 +1255,8 @@ int qemuMonitorGetCPUInfo(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p", mon);
|
VIR_DEBUG("mon=%p", mon);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1275,8 +1275,8 @@ int qemuMonitorSetLink(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p, name=%p:%s, state=%u", mon, name, name, state);
|
VIR_DEBUG("mon=%p, name=%p:%s, state=%u", mon, name, name, state);
|
||||||
|
|
||||||
if (!mon || !name) {
|
if (!mon || !name) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor || name must not be NULL"));
|
_("monitor || name must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1294,8 +1294,8 @@ int qemuMonitorGetVirtType(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p", mon);
|
VIR_DEBUG("mon=%p", mon);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1314,8 +1314,8 @@ int qemuMonitorGetBalloonInfo(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p", mon);
|
VIR_DEBUG("mon=%p", mon);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1335,8 +1335,8 @@ int qemuMonitorGetMemoryStats(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p stats=%p nstats=%u", mon, stats, nr_stats);
|
VIR_DEBUG("mon=%p stats=%p nstats=%u", mon, stats, nr_stats);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1353,8 +1353,8 @@ qemuMonitorBlockIOStatusToError(const char *status)
|
|||||||
int st = qemuMonitorBlockIOStatusTypeFromString(status);
|
int st = qemuMonitorBlockIOStatusTypeFromString(status);
|
||||||
|
|
||||||
if (st < 0) {
|
if (st < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unknown block IO status: %s"), status);
|
_("unknown block IO status: %s"), status);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1382,8 +1382,8 @@ qemuMonitorGetBlockInfo(qemuMonitorPtr mon)
|
|||||||
VIR_DEBUG("mon=%p", mon);
|
VIR_DEBUG("mon=%p", mon);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1412,9 +1412,9 @@ qemuMonitorBlockInfoLookup(virHashTablePtr blockInfo,
|
|||||||
VIR_DEBUG("blockInfo=%p dev=%s", blockInfo, NULLSTR(devname));
|
VIR_DEBUG("blockInfo=%p dev=%s", blockInfo, NULLSTR(devname));
|
||||||
|
|
||||||
if (!(info = virHashLookup(blockInfo, devname))) {
|
if (!(info = virHashLookup(blockInfo, devname))) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot find info for device '%s'"),
|
_("cannot find info for device '%s'"),
|
||||||
NULLSTR(devname));
|
NULLSTR(devname));
|
||||||
}
|
}
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
@ -1436,8 +1436,8 @@ int qemuMonitorGetBlockStatsInfo(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p dev=%s", mon, dev_name);
|
VIR_DEBUG("mon=%p dev=%s", mon, dev_name);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1472,8 +1472,8 @@ int qemuMonitorGetBlockStatsParamsNumber(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p nparams=%p", mon, nparams);
|
VIR_DEBUG("mon=%p nparams=%p", mon, nparams);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1525,8 +1525,8 @@ int qemuMonitorSetVNCPassword(qemuMonitorPtr mon,
|
|||||||
mon, password);
|
mon, password);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1548,9 +1548,9 @@ static const char* qemuMonitorTypeToProtocol(int type)
|
|||||||
case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
|
case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
|
||||||
return "spice";
|
return "spice";
|
||||||
default:
|
default:
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG,
|
virReportError(VIR_ERR_INVALID_ARG,
|
||||||
_("unsupported protocol type %s"),
|
_("unsupported protocol type %s"),
|
||||||
virDomainGraphicsTypeToString(type));
|
virDomainGraphicsTypeToString(type));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1571,8 +1571,8 @@ int qemuMonitorSetPassword(qemuMonitorPtr mon,
|
|||||||
mon, protocol, password, action_if_connected);
|
mon, protocol, password, action_if_connected);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1603,8 +1603,8 @@ int qemuMonitorExpirePassword(qemuMonitorPtr mon,
|
|||||||
mon, protocol, expire_time);
|
mon, protocol, expire_time);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1625,8 +1625,8 @@ int qemuMonitorSetBalloon(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p newmem=%lu", mon, newmem);
|
VIR_DEBUG("mon=%p newmem=%lu", mon, newmem);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1644,8 +1644,8 @@ int qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, int online)
|
|||||||
VIR_DEBUG("mon=%p cpu=%d online=%d", mon, cpu, online);
|
VIR_DEBUG("mon=%p cpu=%d online=%d", mon, cpu, online);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1665,8 +1665,8 @@ int qemuMonitorEjectMedia(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p dev_name=%s force=%d", mon, dev_name, force);
|
VIR_DEBUG("mon=%p dev_name=%s force=%d", mon, dev_name, force);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1688,8 +1688,8 @@ int qemuMonitorChangeMedia(qemuMonitorPtr mon,
|
|||||||
mon, dev_name, newmedia, format);
|
mon, dev_name, newmedia, format);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1711,8 +1711,8 @@ int qemuMonitorSaveVirtualMemory(qemuMonitorPtr mon,
|
|||||||
mon, offset, length, path);
|
mon, offset, length, path);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1733,8 +1733,8 @@ int qemuMonitorSavePhysicalMemory(qemuMonitorPtr mon,
|
|||||||
mon, offset, length, path);
|
mon, offset, length, path);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1753,8 +1753,8 @@ int qemuMonitorSetMigrationSpeed(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p bandwidth=%lu", mon, bandwidth);
|
VIR_DEBUG("mon=%p bandwidth=%lu", mon, bandwidth);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1773,8 +1773,8 @@ int qemuMonitorSetMigrationDowntime(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p downtime=%llu", mon, downtime);
|
VIR_DEBUG("mon=%p downtime=%llu", mon, downtime);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1796,8 +1796,8 @@ int qemuMonitorGetMigrationStatus(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p", mon);
|
VIR_DEBUG("mon=%p", mon);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1824,8 +1824,8 @@ int qemuMonitorMigrateToFd(qemuMonitorPtr mon,
|
|||||||
mon, fd, flags);
|
mon, fd, flags);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1857,8 +1857,8 @@ int qemuMonitorMigrateToHost(qemuMonitorPtr mon,
|
|||||||
mon, hostname, port, flags);
|
mon, hostname, port, flags);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1889,8 +1889,8 @@ int qemuMonitorMigrateToCommand(qemuMonitorPtr mon,
|
|||||||
mon, argv, flags);
|
mon, argv, flags);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1931,15 +1931,15 @@ int qemuMonitorMigrateToFile(qemuMonitorPtr mon,
|
|||||||
mon, argv, target, offset, flags);
|
mon, argv, target, offset, flags);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (offset % QEMU_MONITOR_MIGRATE_TO_FILE_BS) {
|
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"),
|
_("file offset must be a multiple of %llu"),
|
||||||
QEMU_MONITOR_MIGRATE_TO_FILE_BS);
|
QEMU_MONITOR_MIGRATE_TO_FILE_BS);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1996,8 +1996,8 @@ int qemuMonitorMigrateToUnix(qemuMonitorPtr mon,
|
|||||||
mon, unixfile, flags);
|
mon, unixfile, flags);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2021,8 +2021,8 @@ int qemuMonitorMigrateCancel(qemuMonitorPtr mon)
|
|||||||
VIR_DEBUG("mon=%p", mon);
|
VIR_DEBUG("mon=%p", mon);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2044,8 +2044,8 @@ int qemuMonitorDumpToFd(qemuMonitorPtr mon,
|
|||||||
mon, fd, flags, begin, length);
|
mon, fd, flags, begin, length);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2053,8 +2053,8 @@ int qemuMonitorDumpToFd(qemuMonitorPtr mon,
|
|||||||
/* We don't have qemuMonitorTextDump(), so we should check mon->json
|
/* We don't have qemuMonitorTextDump(), so we should check mon->json
|
||||||
* here.
|
* here.
|
||||||
*/
|
*/
|
||||||
qemuReportError(VIR_ERR_NO_SUPPORT, "%s",
|
virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||||
_("dump-guest-memory is not supported in text mode"));
|
_("dump-guest-memory is not supported in text mode"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2108,8 +2108,8 @@ int qemuMonitorAddUSBDisk(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p path=%s", mon, path);
|
VIR_DEBUG("mon=%p path=%s", mon, path);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2129,8 +2129,8 @@ int qemuMonitorAddUSBDeviceExact(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p bus=%d dev=%d", mon, bus, dev);
|
VIR_DEBUG("mon=%p bus=%d dev=%d", mon, bus, dev);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2150,8 +2150,8 @@ int qemuMonitorAddUSBDeviceMatch(qemuMonitorPtr mon,
|
|||||||
mon, vendor, product);
|
mon, vendor, product);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2173,8 +2173,8 @@ int qemuMonitorAddPCIHostDevice(qemuMonitorPtr mon,
|
|||||||
hostAddr->domain, hostAddr->bus, hostAddr->slot, hostAddr->function);
|
hostAddr->domain, hostAddr->bus, hostAddr->slot, hostAddr->function);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2196,8 +2196,8 @@ int qemuMonitorAddPCIDisk(qemuMonitorPtr mon,
|
|||||||
mon, path, bus);
|
mon, path, bus);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2217,8 +2217,8 @@ int qemuMonitorAddPCINetwork(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p nicstr=%s", mon, nicstr);
|
VIR_DEBUG("mon=%p nicstr=%s", mon, nicstr);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2239,8 +2239,8 @@ int qemuMonitorRemovePCIDevice(qemuMonitorPtr mon,
|
|||||||
guestAddr->slot, guestAddr->function);
|
guestAddr->slot, guestAddr->function);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2261,21 +2261,21 @@ int qemuMonitorSendFileHandle(qemuMonitorPtr mon,
|
|||||||
mon, fdname, fd);
|
mon, fdname, fd);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("fd must be valid"));
|
_("fd must be valid"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mon->hasSendFD) {
|
if (!mon->hasSendFD) {
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("qemu is not using a unix socket monitor, "
|
_("qemu is not using a unix socket monitor, "
|
||||||
"cannot send fd %s"), fdname);
|
"cannot send fd %s"), fdname);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2299,8 +2299,8 @@ int qemuMonitorCloseFileHandle(qemuMonitorPtr mon,
|
|||||||
error = virSaveLastError();
|
error = virSaveLastError();
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2330,8 +2330,8 @@ int qemuMonitorAddHostNetwork(qemuMonitorPtr mon,
|
|||||||
vhostfd, NULLSTR(vhostfd_name));
|
vhostfd, NULLSTR(vhostfd_name));
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2369,8 +2369,8 @@ int qemuMonitorRemoveHostNetwork(qemuMonitorPtr mon,
|
|||||||
mon, netname);
|
mon, netname);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2394,8 +2394,8 @@ int qemuMonitorAddNetdev(qemuMonitorPtr mon,
|
|||||||
vhostfd, NULLSTR(vhostfd_name));
|
vhostfd, NULLSTR(vhostfd_name));
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2431,8 +2431,8 @@ int qemuMonitorRemoveNetdev(qemuMonitorPtr mon,
|
|||||||
mon, alias);
|
mon, alias);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2452,8 +2452,8 @@ int qemuMonitorGetPtyPaths(qemuMonitorPtr mon,
|
|||||||
mon);
|
mon);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2473,8 +2473,8 @@ int qemuMonitorAttachPCIDiskController(qemuMonitorPtr mon,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2499,8 +2499,8 @@ int qemuMonitorAttachDrive(qemuMonitorPtr mon,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2519,8 +2519,8 @@ int qemuMonitorGetAllPCIAddresses(qemuMonitorPtr mon,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2538,8 +2538,8 @@ int qemuMonitorDriveDel(qemuMonitorPtr mon,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2557,8 +2557,8 @@ int qemuMonitorDelDevice(qemuMonitorPtr mon,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2580,8 +2580,8 @@ int qemuMonitorAddDeviceWithFd(qemuMonitorPtr mon,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2614,8 +2614,8 @@ int qemuMonitorAddDrive(qemuMonitorPtr mon,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2635,8 +2635,8 @@ int qemuMonitorSetDrivePassphrase(qemuMonitorPtr mon,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2654,8 +2654,8 @@ int qemuMonitorCreateSnapshot(qemuMonitorPtr mon, const char *name)
|
|||||||
VIR_DEBUG("mon=%p, name=%s",mon,name);
|
VIR_DEBUG("mon=%p, name=%s",mon,name);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2673,8 +2673,8 @@ int qemuMonitorLoadSnapshot(qemuMonitorPtr mon, const char *name)
|
|||||||
VIR_DEBUG("mon=%p, name=%s",mon,name);
|
VIR_DEBUG("mon=%p, name=%s",mon,name);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2692,8 +2692,8 @@ int qemuMonitorDeleteSnapshot(qemuMonitorPtr mon, const char *name)
|
|||||||
VIR_DEBUG("mon=%p, name=%s",mon,name);
|
VIR_DEBUG("mon=%p, name=%s",mon,name);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2718,8 +2718,8 @@ qemuMonitorDiskSnapshot(qemuMonitorPtr mon, virJSONValuePtr actions,
|
|||||||
mon, actions, device, file, format, reuse);
|
mon, actions, device, file, format, reuse);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2728,8 +2728,8 @@ qemuMonitorDiskSnapshot(qemuMonitorPtr mon, virJSONValuePtr actions,
|
|||||||
reuse);
|
reuse);
|
||||||
} else {
|
} else {
|
||||||
if (actions || STRNEQ(format, "qcow2") || reuse) {
|
if (actions || STRNEQ(format, "qcow2") || reuse) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("text monitor lacks several snapshot features"));
|
_("text monitor lacks several snapshot features"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ret = qemuMonitorTextDiskSnapshot(mon, device, file);
|
ret = qemuMonitorTextDiskSnapshot(mon, device, file);
|
||||||
@ -2748,8 +2748,8 @@ qemuMonitorTransaction(qemuMonitorPtr mon, virJSONValuePtr actions)
|
|||||||
if (mon->json)
|
if (mon->json)
|
||||||
ret = qemuMonitorJSONTransaction(mon, actions);
|
ret = qemuMonitorJSONTransaction(mon, actions);
|
||||||
else
|
else
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("transaction requires JSON monitor"));
|
_("transaction requires JSON monitor"));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2808,8 +2808,8 @@ int qemuMonitorScreendump(qemuMonitorPtr mon,
|
|||||||
VIR_DEBUG("mon=%p, file=%s", mon, file);
|
VIR_DEBUG("mon=%p, file=%s", mon, file);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG,"%s",
|
virReportError(VIR_ERR_INVALID_ARG,"%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2839,9 +2839,9 @@ int qemuMonitorBlockJob(qemuMonitorPtr mon,
|
|||||||
/* Convert bandwidth MiB to bytes */
|
/* Convert bandwidth MiB to bytes */
|
||||||
speed = bandwidth;
|
speed = bandwidth;
|
||||||
if (speed > ULLONG_MAX / 1024 / 1024) {
|
if (speed > ULLONG_MAX / 1024 / 1024) {
|
||||||
qemuReportError(VIR_ERR_OVERFLOW,
|
virReportError(VIR_ERR_OVERFLOW,
|
||||||
_("bandwidth must be less than %llu"),
|
_("bandwidth must be less than %llu"),
|
||||||
ULLONG_MAX / 1024 / 1024);
|
ULLONG_MAX / 1024 / 1024);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
speed <<= 20;
|
speed <<= 20;
|
||||||
@ -2850,8 +2850,8 @@ int qemuMonitorBlockJob(qemuMonitorPtr mon,
|
|||||||
ret = qemuMonitorJSONBlockJob(mon, device, base, speed, info, mode,
|
ret = qemuMonitorJSONBlockJob(mon, device, base, speed, info, mode,
|
||||||
modern);
|
modern);
|
||||||
else
|
else
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("block jobs require JSON monitor"));
|
_("block jobs require JSON monitor"));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2950,8 +2950,8 @@ int qemuMonitorOpenGraphics(qemuMonitorPtr mon,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2976,14 +2976,14 @@ int qemuMonitorSystemWakeup(qemuMonitorPtr mon)
|
|||||||
VIR_DEBUG("mon=%p", mon);
|
VIR_DEBUG("mon=%p", mon);
|
||||||
|
|
||||||
if (!mon) {
|
if (!mon) {
|
||||||
qemuReportError(VIR_ERR_INVALID_ARG, "%s",
|
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||||
_("monitor must not be NULL"));
|
_("monitor must not be NULL"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mon->json) {
|
if (!mon->json) {
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("JSON monitor is required"));
|
_("JSON monitor is required"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -368,9 +368,9 @@ qemuProcessFindDomainDiskByPath(virDomainObjPtr vm,
|
|||||||
if (i >= 0)
|
if (i >= 0)
|
||||||
return vm->def->disks[i];
|
return vm->def->disks[i];
|
||||||
|
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("no disk found with path %s"),
|
_("no disk found with path %s"),
|
||||||
path);
|
path);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -391,9 +391,9 @@ qemuProcessFindDomainDiskByAlias(virDomainObjPtr vm,
|
|||||||
return disk;
|
return disk;
|
||||||
}
|
}
|
||||||
|
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("no disk found with alias %s"),
|
_("no disk found with alias %s"),
|
||||||
alias);
|
alias);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -411,24 +411,24 @@ qemuProcessGetVolumeQcowPassphrase(virConnectPtr conn,
|
|||||||
virStorageEncryptionPtr enc;
|
virStorageEncryptionPtr enc;
|
||||||
|
|
||||||
if (!disk->encryption) {
|
if (!disk->encryption) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("disk %s does not have any encryption information"),
|
_("disk %s does not have any encryption information"),
|
||||||
disk->src);
|
disk->src);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
enc = disk->encryption;
|
enc = disk->encryption;
|
||||||
|
|
||||||
if (!conn) {
|
if (!conn) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("cannot find secrets without a connection"));
|
"%s", _("cannot find secrets without a connection"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conn->secretDriver == NULL ||
|
if (conn->secretDriver == NULL ||
|
||||||
conn->secretDriver->lookupByUUID == NULL ||
|
conn->secretDriver->lookupByUUID == NULL ||
|
||||||
conn->secretDriver->getValue == NULL) {
|
conn->secretDriver->getValue == NULL) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
|
||||||
_("secret storage not supported"));
|
_("secret storage not supported"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -436,8 +436,8 @@ qemuProcessGetVolumeQcowPassphrase(virConnectPtr conn,
|
|||||||
enc->nsecrets != 1 ||
|
enc->nsecrets != 1 ||
|
||||||
enc->secrets[0]->type !=
|
enc->secrets[0]->type !=
|
||||||
VIR_STORAGE_ENCRYPTION_SECRET_TYPE_PASSPHRASE) {
|
VIR_STORAGE_ENCRYPTION_SECRET_TYPE_PASSPHRASE) {
|
||||||
qemuReportError(VIR_ERR_XML_ERROR,
|
virReportError(VIR_ERR_XML_ERROR,
|
||||||
_("invalid <encryption> for volume %s"), disk->src);
|
_("invalid <encryption> for volume %s"), disk->src);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -454,9 +454,9 @@ qemuProcessGetVolumeQcowPassphrase(virConnectPtr conn,
|
|||||||
if (memchr(data, '\0', size) != NULL) {
|
if (memchr(data, '\0', size) != NULL) {
|
||||||
memset(data, 0, size);
|
memset(data, 0, size);
|
||||||
VIR_FREE(data);
|
VIR_FREE(data);
|
||||||
qemuReportError(VIR_ERR_XML_ERROR,
|
virReportError(VIR_ERR_XML_ERROR,
|
||||||
_("format='qcow' passphrase for %s must not contain a "
|
_("format='qcow' passphrase for %s must not contain a "
|
||||||
"'\\0'"), disk->src);
|
"'\\0'"), disk->src);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -550,8 +550,8 @@ qemuProcessFakeReboot(void *opaque)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!virDomainObjIsActive(vm)) {
|
if (!virDomainObjIsActive(vm)) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("guest unexpectedly quit"));
|
_("guest unexpectedly quit"));
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -563,8 +563,8 @@ qemuProcessFakeReboot(void *opaque)
|
|||||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||||
|
|
||||||
if (!virDomainObjIsActive(vm)) {
|
if (!virDomainObjIsActive(vm)) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("guest unexpectedly quit"));
|
_("guest unexpectedly quit"));
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,8 +572,8 @@ qemuProcessFakeReboot(void *opaque)
|
|||||||
VIR_DOMAIN_RUNNING_BOOTED,
|
VIR_DOMAIN_RUNNING_BOOTED,
|
||||||
QEMU_ASYNC_JOB_NONE) < 0) {
|
QEMU_ASYNC_JOB_NONE) < 0) {
|
||||||
if (virGetLastError() == NULL)
|
if (virGetLastError() == NULL)
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("resume operation failed"));
|
"%s", _("resume operation failed"));
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
priv->gotShutdown = false;
|
priv->gotShutdown = false;
|
||||||
@ -1326,16 +1326,16 @@ qemuProcessReadLogOutput(virDomainObjPtr vm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (got == buflen-1) {
|
if (got == buflen-1) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Out of space while reading %s log output: %s"),
|
_("Out of space while reading %s log output: %s"),
|
||||||
what, buf);
|
what, buf);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isdead) {
|
if (isdead) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Process exited while reading %s log output: %s"),
|
_("Process exited while reading %s log output: %s"),
|
||||||
what, buf);
|
what, buf);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1348,9 +1348,9 @@ qemuProcessReadLogOutput(virDomainObjPtr vm,
|
|||||||
retries--;
|
retries--;
|
||||||
}
|
}
|
||||||
|
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Timed out while reading %s log output: %s"),
|
_("Timed out while reading %s log output: %s"),
|
||||||
what, buf);
|
what, buf);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(debug);
|
VIR_FREE(debug);
|
||||||
@ -1435,8 +1435,8 @@ qemuProcessLookupPTYs(virDomainChrDefPtr *devices,
|
|||||||
/* neither the log output nor 'info chardev' had a
|
/* neither the log output nor 'info chardev' had a
|
||||||
* pty path for this chardev, report an error
|
* 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);
|
_("no assigned pty for device %s"), id);
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
/* 'info chardev' had no pty path for this chardev,
|
/* 'info chardev' had no pty path for this chardev,
|
||||||
@ -1627,9 +1627,9 @@ cleanup:
|
|||||||
/* VM is dead, any other error raised in the interim is probably
|
/* VM is dead, any other error raised in the interim is probably
|
||||||
* not as important as the qemu cmdline output */
|
* not as important as the qemu cmdline output */
|
||||||
qemuProcessReadLogFD(logfd, buf, buf_size, strlen(buf));
|
qemuProcessReadLogFD(logfd, buf, buf_size, strlen(buf));
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("process exited while connecting to monitor: %s"),
|
_("process exited while connecting to monitor: %s"),
|
||||||
buf);
|
buf);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1672,10 +1672,10 @@ qemuProcessDetectVcpuPIDs(struct qemud_driver *driver,
|
|||||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||||
|
|
||||||
if (ncpupids != vm->def->vcpus) {
|
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 wrong number of vCPU pids from QEMU monitor. "
|
||||||
"got %d, wanted %d"),
|
"got %d, wanted %d"),
|
||||||
ncpupids, vm->def->vcpus);
|
ncpupids, vm->def->vcpus);
|
||||||
VIR_FREE(cpupids);
|
VIR_FREE(cpupids);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1720,8 +1720,8 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (numa_available() < 0) {
|
if (numa_available() < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("Host kernel is not aware of NUMA."));
|
"%s", _("Host kernel is not aware of NUMA."));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1731,8 +1731,8 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm,
|
|||||||
for (i = 0; i < VIR_DOMAIN_CPUMASK_LEN; i++) {
|
for (i = 0; i < VIR_DOMAIN_CPUMASK_LEN; i++) {
|
||||||
if (tmp_nodemask[i]) {
|
if (tmp_nodemask[i]) {
|
||||||
if (i > NUMA_NUM_NODES) {
|
if (i > NUMA_NUM_NODES) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Host cannot support NUMA node %d"), i);
|
_("Host cannot support NUMA node %d"), i);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (i > maxnode && !warned) {
|
if (i > maxnode && !warned) {
|
||||||
@ -1760,9 +1760,9 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (nnodes != 1) {
|
if (nnodes != 1) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("NUMA memory tuning in 'preferred' mode "
|
"%s", _("NUMA memory tuning in 'preferred' mode "
|
||||||
"only supports single node"));
|
"only supports single node"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1774,8 +1774,8 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm,
|
|||||||
/* XXX: Shouldn't go here, as we already do checking when
|
/* XXX: Shouldn't go here, as we already do checking when
|
||||||
* parsing domain XML.
|
* parsing domain XML.
|
||||||
*/
|
*/
|
||||||
qemuReportError(VIR_ERR_XML_ERROR,
|
virReportError(VIR_ERR_XML_ERROR,
|
||||||
"%s", _("Invalid mode for memory NUMA tuning."));
|
"%s", _("Invalid mode for memory NUMA tuning."));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1790,8 +1790,8 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm,
|
|||||||
const char *nodemask ATTRIBUTE_UNUSED)
|
const char *nodemask ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
if (vm->def->numatune.memory.nodemask) {
|
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"));
|
_("libvirt is compiled without NUMA tuning support"));
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1814,9 +1814,9 @@ qemuGetNumadAdvice(virDomainDefPtr def)
|
|||||||
virCommandSetOutputBuffer(cmd, &output);
|
virCommandSetOutputBuffer(cmd, &output);
|
||||||
|
|
||||||
if (virCommandRun(cmd, NULL) < 0)
|
if (virCommandRun(cmd, NULL) < 0)
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Failed to query numad for the "
|
_("Failed to query numad for the "
|
||||||
"advisory nodeset"));
|
"advisory nodeset"));
|
||||||
|
|
||||||
virCommandFree(cmd);
|
virCommandFree(cmd);
|
||||||
return output;
|
return output;
|
||||||
@ -1825,8 +1825,8 @@ qemuGetNumadAdvice(virDomainDefPtr def)
|
|||||||
static char *
|
static char *
|
||||||
qemuGetNumadAdvice(virDomainDefPtr def ATTRIBUTE_UNUSED)
|
qemuGetNumadAdvice(virDomainDefPtr def ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
_("numad is not available on this host"));
|
_("numad is not available on this host"));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1920,8 +1920,8 @@ qemuProcessSetLinkStates(virDomainObjPtr vm)
|
|||||||
VIR_DEBUG("Setting link state: %s", def->nets[i]->info.alias);
|
VIR_DEBUG("Setting link state: %s", def->nets[i]->info.alias);
|
||||||
|
|
||||||
if (!qemuCapsGet(priv->qemuCaps, QEMU_CAPS_NETDEV)) {
|
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"));
|
_("Setting of link state is not supported by this qemu"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1929,7 +1929,7 @@ qemuProcessSetLinkStates(virDomainObjPtr vm)
|
|||||||
def->nets[i]->info.alias,
|
def->nets[i]->info.alias,
|
||||||
VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN);
|
VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN);
|
||||||
if (ret != 0) {
|
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);
|
_("Couldn't set link state on interface: %s"), def->nets[i]->info.alias);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1961,8 +1961,8 @@ qemuProcessSetVcpuAffinites(virConnectPtr conn,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (priv->vcpupids == NULL) {
|
if (priv->vcpupids == NULL) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
"%s", _("cpu affinity is not supported"));
|
"%s", _("cpu affinity is not supported"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2330,9 +2330,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
|
|||||||
if (qemuProcessAssignNextPCIAddress(&(vm->def->disks[i]->info),
|
if (qemuProcessAssignNextPCIAddress(&(vm->def->disks[i]->info),
|
||||||
vendor, product,
|
vendor, product,
|
||||||
addrs, naddrs) < 0) {
|
addrs, naddrs) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot find PCI address for VirtIO disk %s"),
|
_("cannot find PCI address for VirtIO disk %s"),
|
||||||
vm->def->disks[i]->dst);
|
vm->def->disks[i]->dst);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2344,9 +2344,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
|
|||||||
if (qemuProcessAssignNextPCIAddress(&(vm->def->nets[i]->info),
|
if (qemuProcessAssignNextPCIAddress(&(vm->def->nets[i]->info),
|
||||||
vendor, product,
|
vendor, product,
|
||||||
addrs, naddrs) < 0) {
|
addrs, naddrs) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot find PCI address for %s NIC"),
|
_("cannot find PCI address for %s NIC"),
|
||||||
vm->def->nets[i]->model);
|
vm->def->nets[i]->model);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2358,9 +2358,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
|
|||||||
if (qemuProcessAssignNextPCIAddress(&(vm->def->controllers[i]->info),
|
if (qemuProcessAssignNextPCIAddress(&(vm->def->controllers[i]->info),
|
||||||
vendor, product,
|
vendor, product,
|
||||||
addrs, naddrs) < 0) {
|
addrs, naddrs) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot find PCI address for controller %s"),
|
_("cannot find PCI address for controller %s"),
|
||||||
virDomainControllerTypeToString(vm->def->controllers[i]->type));
|
virDomainControllerTypeToString(vm->def->controllers[i]->type));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2372,9 +2372,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
|
|||||||
if (qemuProcessAssignNextPCIAddress(&(vm->def->videos[i]->info),
|
if (qemuProcessAssignNextPCIAddress(&(vm->def->videos[i]->info),
|
||||||
vendor, product,
|
vendor, product,
|
||||||
addrs, naddrs) < 0) {
|
addrs, naddrs) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot find PCI address for video adapter %s"),
|
_("cannot find PCI address for video adapter %s"),
|
||||||
virDomainVideoTypeToString(vm->def->videos[i]->type));
|
virDomainVideoTypeToString(vm->def->videos[i]->type));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2386,9 +2386,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
|
|||||||
if (qemuProcessAssignNextPCIAddress(&(vm->def->sounds[i]->info),
|
if (qemuProcessAssignNextPCIAddress(&(vm->def->sounds[i]->info),
|
||||||
vendor, product,
|
vendor, product,
|
||||||
addrs, naddrs) < 0) {
|
addrs, naddrs) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot find PCI address for sound adapter %s"),
|
_("cannot find PCI address for sound adapter %s"),
|
||||||
virDomainSoundModelTypeToString(vm->def->sounds[i]->model));
|
virDomainSoundModelTypeToString(vm->def->sounds[i]->model));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2399,9 +2399,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
|
|||||||
if (qemuProcessAssignNextPCIAddress(&(vm->def->watchdog->info),
|
if (qemuProcessAssignNextPCIAddress(&(vm->def->watchdog->info),
|
||||||
vendor, product,
|
vendor, product,
|
||||||
addrs, naddrs) < 0) {
|
addrs, naddrs) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot find PCI address for watchdog %s"),
|
_("cannot find PCI address for watchdog %s"),
|
||||||
virDomainWatchdogModelTypeToString(vm->def->watchdog->model));
|
virDomainWatchdogModelTypeToString(vm->def->watchdog->model));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2411,9 +2411,9 @@ qemuProcessDetectPCIAddresses(virDomainObjPtr vm,
|
|||||||
if (qemuProcessAssignNextPCIAddress(&(vm->def->memballoon->info),
|
if (qemuProcessAssignNextPCIAddress(&(vm->def->memballoon->info),
|
||||||
vendor, product,
|
vendor, product,
|
||||||
addrs, naddrs) < 0) {
|
addrs, naddrs) < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot find PCI address for balloon %s"),
|
_("cannot find PCI address for balloon %s"),
|
||||||
virDomainMemballoonModelTypeToString(vm->def->memballoon->model));
|
virDomainMemballoonModelTypeToString(vm->def->memballoon->model));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3273,9 +3273,9 @@ qemuProcessReconnectHelper(void *payload,
|
|||||||
|
|
||||||
virConnectClose(data->conn);
|
virConnectClose(data->conn);
|
||||||
|
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("Could not create thread. QEMU initialization "
|
_("Could not create thread. QEMU initialization "
|
||||||
"might be incomplete"));
|
"might be incomplete"));
|
||||||
if (qemuDomainObjEndJob(src->driver, obj) == 0) {
|
if (qemuDomainObjEndJob(src->driver, obj) == 0) {
|
||||||
obj = NULL;
|
obj = NULL;
|
||||||
} else if (virDomainObjUnref(obj) > 0) {
|
} else if (virDomainObjUnref(obj) > 0) {
|
||||||
@ -3354,8 +3354,8 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
VIR_DEBUG("Beginning VM startup process");
|
VIR_DEBUG("Beginning VM startup process");
|
||||||
|
|
||||||
if (virDomainObjIsActive(vm)) {
|
if (virDomainObjIsActive(vm)) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
"%s", _("VM is already active"));
|
"%s", _("VM is already active"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3420,8 +3420,8 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
vm->def->graphics[0]->data.vnc.autoport) {
|
vm->def->graphics[0]->data.vnc.autoport) {
|
||||||
int port = qemuProcessNextFreePort(driver, QEMU_VNC_PORT_MIN);
|
int port = qemuProcessNextFreePort(driver, QEMU_VNC_PORT_MIN);
|
||||||
if (port < 0) {
|
if (port < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("Unable to find an unused VNC port"));
|
"%s", _("Unable to find an unused VNC port"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
vm->def->graphics[0]->data.vnc.port = port;
|
vm->def->graphics[0]->data.vnc.port = port;
|
||||||
@ -3432,8 +3432,8 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
port = qemuProcessNextFreePort(driver, QEMU_VNC_PORT_MIN);
|
port = qemuProcessNextFreePort(driver, QEMU_VNC_PORT_MIN);
|
||||||
|
|
||||||
if (port < 0) {
|
if (port < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("Unable to find an unused SPICE port"));
|
"%s", _("Unable to find an unused SPICE port"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3446,8 +3446,8 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
int tlsPort = qemuProcessNextFreePort(driver,
|
int tlsPort = qemuProcessNextFreePort(driver,
|
||||||
vm->def->graphics[0]->data.spice.port + 1);
|
vm->def->graphics[0]->data.spice.port + 1);
|
||||||
if (tlsPort < 0) {
|
if (tlsPort < 0) {
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("Unable to find an unused SPICE TLS port"));
|
"%s", _("Unable to find an unused SPICE TLS port"));
|
||||||
qemuProcessReturnPort(driver, port);
|
qemuProcessReturnPort(driver, port);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@ -3492,10 +3492,10 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
if (vm->def->virtType == VIR_DOMAIN_VIRT_KVM) {
|
if (vm->def->virtType == VIR_DOMAIN_VIRT_KVM) {
|
||||||
VIR_DEBUG("Checking for KVM availability");
|
VIR_DEBUG("Checking for KVM availability");
|
||||||
if (access("/dev/kvm", F_OK) != 0) {
|
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. "
|
_("Domain requires KVM, but it is not available. "
|
||||||
"Check that virtualization is enabled in the host BIOS, "
|
"Check that virtualization is enabled in the host BIOS, "
|
||||||
"and host configuration is setup to load the kvm modules."));
|
"and host configuration is setup to load the kvm modules."));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3658,8 +3658,8 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
/* wait for qemu process to show up */
|
/* wait for qemu process to show up */
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
if (virPidFileReadPath(priv->pidfile, &vm->pid) < 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);
|
_("Domain %s didn't show up"), vm->def->name);
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
@ -3790,9 +3790,9 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
VIR_DEBUG("Setting initial memory amount");
|
VIR_DEBUG("Setting initial memory amount");
|
||||||
cur_balloon = vm->def->mem.cur_balloon;
|
cur_balloon = vm->def->mem.cur_balloon;
|
||||||
if (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"),
|
_("unable to set balloon to %lld"),
|
||||||
vm->def->mem.cur_balloon);
|
vm->def->mem.cur_balloon);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
qemuDomainObjEnterMonitorWithDriver(driver, vm);
|
qemuDomainObjEnterMonitorWithDriver(driver, vm);
|
||||||
@ -3809,8 +3809,8 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
VIR_DOMAIN_RUNNING_BOOTED,
|
VIR_DOMAIN_RUNNING_BOOTED,
|
||||||
QEMU_ASYNC_JOB_NONE) < 0) {
|
QEMU_ASYNC_JOB_NONE) < 0) {
|
||||||
if (virGetLastError() == NULL)
|
if (virGetLastError() == NULL)
|
||||||
qemuReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("resume operation failed"));
|
"%s", _("resume operation failed"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -4199,8 +4199,8 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
|
|||||||
VIR_DEBUG("Beginning VM attach process");
|
VIR_DEBUG("Beginning VM attach process");
|
||||||
|
|
||||||
if (virDomainObjIsActive(vm)) {
|
if (virDomainObjIsActive(vm)) {
|
||||||
qemuReportError(VIR_ERR_OPERATION_INVALID,
|
virReportError(VIR_ERR_OPERATION_INVALID,
|
||||||
"%s", _("VM is already active"));
|
"%s", _("VM is already active"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user