提交 1a09553e 编写于 作者: P Paolo Bonzini 提交者: Chris Lalancette

unbreak migration

Fix migration, broken in two different ways by the QEMU monitor
abstraction.  Note that the QEMU console emits a "\r\n" as the
line-ending.

* src/qemu/qemu_monitor_text.c (qemuMonitorGetMigrationStatus):
Fix "info migrate" command and its output's parsing.
上级 6e16575a
......@@ -1072,7 +1072,7 @@ int qemuMonitorGetMigrationStatus(const virDomainObjPtr vm,
*remaining = 0;
*total = 0;
if (qemuMonitorCommand(vm, "info migration", &reply) < 0) {
if (qemuMonitorCommand(vm, "info migrate", &reply) < 0) {
qemudReportError(NULL, NULL, NULL, VIR_ERR_OPERATION_FAILED,
"%s", _("cannot query migration status"));
return -1;
......@@ -1080,7 +1080,7 @@ int qemuMonitorGetMigrationStatus(const virDomainObjPtr vm,
if ((tmp = strstr(reply, MIGRATION_PREFIX)) != NULL) {
tmp += strlen(MIGRATION_PREFIX);
end = strchr(tmp, '\n');
end = strchr(tmp, '\r');
*end = '\0';
if ((*status = qemuMonitorMigrationStatusTypeFromString(tmp)) < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册