aboutsummaryrefslogtreecommitdiff
path: root/migration/savevm.c
diff options
context:
space:
mode:
Diffstat (limited to 'migration/savevm.c')
-rw-r--r--migration/savevm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/migration/savevm.c b/migration/savevm.c
index eb32199888..0596f7bc61 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1316,7 +1316,7 @@ static int loadvm_postcopy_ram_handle_discard(MigrationIncomingState *mis,
switch (ps) {
case POSTCOPY_INCOMING_ADVISE:
/* 1st discard */
- tmp = 0; /* TODO: later patch postcopy_ram_prepare_discard(mis); */
+ tmp = postcopy_ram_prepare_discard(mis);
if (tmp) {
return tmp;
}
@@ -1448,6 +1448,13 @@ static int loadvm_postcopy_handle_listen(MigrationIncomingState *mis)
error_report("CMD_POSTCOPY_LISTEN in wrong postcopy state (%d)", ps);
return -1;
}
+ if (ps == POSTCOPY_INCOMING_ADVISE) {
+ /*
+ * A rare case, we entered listen without having to do any discards,
+ * so do the setup that's normally done at the time of the 1st discard.
+ */
+ postcopy_ram_prepare_discard(mis);
+ }
/*
* Sensitise RAM - can now generate requests for blocks that don't exist