[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 15/15] migration: Don't allow migration if vm is in POSTMIGRATE
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PULL 15/15] migration: Don't allow migration if vm is in POSTMIGRATE |
Date: |
Fri, 18 Dec 2020 10:41:17 +0000 |
From: Tuguoyi <tu.guoyi@h3c.com>
The following steps will cause qemu assertion failure:
- pause vm by executing 'virsh suspend'
- create external snapshot of memory and disk using 'virsh snapshot-create-as'
- doing the above operation again will cause qemu crash
The backtrace looks like:
at /build/qemu-5.0/migration/savevm.c:1401
at /build/qemu-5.0/migration/savevm.c:1453
When the first migration completes, bs->open_flags will set BDRV_O_INACTIVE
flag by bdrv_inactivate_all(), and during the second migration the
bdrv_inactivate_recurse assert that the bs->open_flags is already
BDRV_O_INACTIVE enabled which cause crash.
As Vladimir suggested, this patch makes migrate_prepare check the state of vm
and
return error if it is in RUN_STATE_POSTMIGRATE state.
Signed-off-by: Tuguoyi <tu.guoyi@h3c.com>
Message-Id: <6b704294ad2e405781c38fb38d68c744@h3c.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reported-by: Li Zhang <li.zhang@cloud.ionos.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@cloud.ionos.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/migration.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/migration/migration.c b/migration/migration.c
index e0dbde4091..f5d4a52c95 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2102,6 +2102,12 @@ static bool migrate_prepare(MigrationState *s, bool blk,
bool blk_inc,
return false;
}
+ if (runstate_check(RUN_STATE_POSTMIGRATE)) {
+ error_setg(errp, "Can't migrate the vm that was paused due to "
+ "previous migration");
+ return false;
+ }
+
if (migration_is_blocked(errp)) {
return false;
}
--
2.29.2
- [PULL 04/15] hmp-commands.hx: List abbreviation after command for cont, quit, print, (continued)
- [PULL 04/15] hmp-commands.hx: List abbreviation after command for cont, quit, print, Dr. David Alan Gilbert (git), 2020/12/18
- [PULL 06/15] virtiofsd: make the debug log timestamp on stderr more human-readable, Dr. David Alan Gilbert (git), 2020/12/18
- [PULL 07/15] virtiofsd: Set up posix_lock hash table for root inode, Dr. David Alan Gilbert (git), 2020/12/18
- [PULL 08/15] virtiofsd: Disable posix_lock hash table if remote locks are not enabled, Dr. David Alan Gilbert (git), 2020/12/18
- [PULL 09/15] virtiofsd: Check file type in lo_flush(), Dr. David Alan Gilbert (git), 2020/12/18
- [PULL 10/15] virtiofsd: update FUSE_FORGET comment on "lo_inode.nlookup", Dr. David Alan Gilbert (git), 2020/12/18
- [PULL 11/15] virtiofsd: Remove useless code about send_notify_iov, Dr. David Alan Gilbert (git), 2020/12/18
- [PULL 13/15] savevm: Remove dead code in save_snapshot(), Dr. David Alan Gilbert (git), 2020/12/18
- [PULL 12/15] docs/devel/migration: Improve debugging section a bit, Dr. David Alan Gilbert (git), 2020/12/18
- [PULL 14/15] savevm: Delete snapshots just created in case of error, Dr. David Alan Gilbert (git), 2020/12/18
- [PULL 15/15] migration: Don't allow migration if vm is in POSTMIGRATE,
Dr. David Alan Gilbert (git) <=
- Re: [PULL 00/15] migration queue, Peter Maydell, 2020/12/31