qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/1] Avoid migration if guest is in postmigrated status


From: Li Zhang
Subject: [PATCH 1/1] Avoid migration if guest is in postmigrated status
Date: Wed, 9 Dec 2020 07:20:29 +0000

This patch is to avoid executing migrations twice, which causes
coredump. After the migration has been completed, guest is in postmigrated
status on source host and the block device is inactive. If executing 
migration again, it will cause coredump and a block error. For exmaple, 
executing #migrate "exec:cat>file" twice on source host, block error:
bdrv_inactivate_recurse: Assertion `!(bs->open_flags & BDRV_O_INACTIVE)' failed

Signed-off-by: Li Zhang <li.zhang@cloud.ionos.com>
---
 migration/migration.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/migration/migration.c b/migration/migration.c
index 87a9b59f83..113f7e1e41 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2115,6 +2115,11 @@ static bool migrate_prepare(MigrationState *s, bool blk, 
bool blk_inc,
         return false;
     }
 
+    if (runstate_check(RUN_STATE_POSTMIGRATE)) {
+        error_setg(errp, "Unable to migrate, guest has been migrated");
+        return false;
+    }
+
     if (migration_is_blocked(errp)) {
         return false;
     }
-- 
2.18.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]