]> Git Repo - qemu.git/commitdiff
hmp: migrate command (without -d) now blocks correctly
authorSoramichi AKIYAMA <[email protected]>
Mon, 27 Jan 2014 10:46:11 +0000 (19:46 +0900)
committerLuiz Capitulino <[email protected]>
Mon, 17 Feb 2014 16:57:22 +0000 (11:57 -0500)
This patch fixes a timing issue that migrate command (without -d) does not
block in some cases.

The original version of hmp.c:hmp_migrate_status_cb checks if the
migration status is 'active' or not to detect the completion of a migration.

However, if this function is executed when the migration status is stil
'setup' (the status before 'active'), migration command returns
immediately even if the user does not specify -d option.

Signed-off-by: Soramichi Akiyama <[email protected]>
Signed-off-by: Luiz Capitulino <[email protected]>
hmp.c

diff --git a/hmp.c b/hmp.c
index 1af08093055e95fb2e5feb3d83e2f98c876eb089..081c12145cbee8e2421988c85b9101f9e7813c0f 100644 (file)
--- a/hmp.c
+++ b/hmp.c
@@ -1234,7 +1234,8 @@ static void hmp_migrate_status_cb(void *opaque)
     MigrationInfo *info;
 
     info = qmp_query_migrate(NULL);
-    if (!info->has_status || strcmp(info->status, "active") == 0) {
+    if (!info->has_status || strcmp(info->status, "active") == 0 ||
+        strcmp(info->status, "setup") == 0) {
         if (info->has_disk) {
             int progress;
 
This page took 0.028403 seconds and 4 git commands to generate.