From: Paolo Bonzini Date: Thu, 1 Oct 2009 18:18:28 +0000 (+0200) Subject: unbreak migration X-Git-Tag: v0.7.2~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a09553e526b027ee5d6b83aefc236d3716590ef;p=thirdparty%2Flibvirt.git 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. --- diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index 5054adfb1e..66526dc656 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -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) {