[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 13/14] migration: Guard ram_bytes_remaining against e
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 13/14] migration: Guard ram_bytes_remaining against early call |
Date: |
Wed, 3 Jan 2018 10:38:33 +0100 |
From: "Dr. David Alan Gilbert" <address@hidden>
Calling ram_bytes_remaining during the early part of setup is unsafe
because the ram_state isn't yet initialised.
This can happen in the sequence:
migrate
migrate_cancel
info migrate
if the migrate sticks trying to connect (e.g. to an unresponsive
destination due to the connect timeout). Here 'info migrate' sees
a state of CANCELLING and so assumes the migrate has partially happened.
partial fix for:
RH bz: https://bugzilla.redhat.com/show_bug.cgi?id=1525899
Reported-by: Xianxian Wang <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
migration/ram.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/migration/ram.c b/migration/ram.c
index 021d583b9b..cb1950f3eb 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -237,7 +237,8 @@ static RAMState *ram_state;
uint64_t ram_bytes_remaining(void)
{
- return ram_state->migration_dirty_pages * TARGET_PAGE_SIZE;
+ return ram_state ? (ram_state->migration_dirty_pages * TARGET_PAGE_SIZE) :
+ 0;
}
MigrationStats ram_counters;
--
2.14.3
- [Qemu-devel] [PULL 02/14] migration: print features as on off, (continued)
- [Qemu-devel] [PULL 02/14] migration: print features as on off, Juan Quintela, 2018/01/03
- [Qemu-devel] [PULL 05/14] migration: free result string, Juan Quintela, 2018/01/03
- [Qemu-devel] [PULL 06/14] migration: fix analyze-migration.py script with radix table, Juan Quintela, 2018/01/03
- [Qemu-devel] [PULL 04/14] docs: Convert migration.txt to rst, Juan Quintela, 2018/01/03
- [Qemu-devel] [PULL 07/14] migration: introduce postcopy-blocktime capability, Juan Quintela, 2018/01/03
- [Qemu-devel] [PULL 08/14] migration: add postcopy blocktime ctx into MigrationIncomingState, Juan Quintela, 2018/01/03
- [Qemu-devel] [PULL 09/14] migration: calculate vCPU blocktime on dst side, Juan Quintela, 2018/01/03
- [Qemu-devel] [PULL 11/14] migration: add blocktime calculation into migration-test, Juan Quintela, 2018/01/03
- [Qemu-devel] [PULL 10/14] migration: postcopy_blocktime documentation, Juan Quintela, 2018/01/03
- [Qemu-devel] [PULL 12/14] migration: add postcopy total blocktime into query-migrate, Juan Quintela, 2018/01/03
- [Qemu-devel] [PULL 13/14] migration: Guard ram_bytes_remaining against early call,
Juan Quintela <=
- [Qemu-devel] [PULL 14/14] migration: finalize current_migration object, Juan Quintela, 2018/01/03
- Re: [Qemu-devel] [PULL 00/14] Migration pull request, Eric Blake, 2018/01/04
- Re: [Qemu-devel] [PULL 00/14] Migration pull request, Peter Maydell, 2018/01/11