]> git.proxmox.com Git - mirror_qemu.git/commitdiff
migration: add more error handling for postcopy_ram_enable_notify
authorFei Li <fli@suse.com>
Sun, 13 Jan 2019 14:08:48 +0000 (22:08 +0800)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Wed, 23 Jan 2019 15:02:07 +0000 (15:02 +0000)
Call postcopy_ram_incoming_cleanup() to do the cleanup when
postcopy_ram_enable_notify fails. Besides, report the error
message when qemu_ram_foreach_migratable_block() fails.

Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Fei Li <fli@suse.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190113140849.38339-5-lifei1214@126.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
migration/postcopy-ram.c
migration/savevm.c

index e5c02a32c5d5daba165782bde797e5ecab18fe54..fa09dba534b8e6a00a3b52e78e9ec7a0948f8ef7 100644 (file)
@@ -1117,6 +1117,7 @@ int postcopy_ram_enable_notify(MigrationIncomingState *mis)
 
     /* Mark so that we get notified of accesses to unwritten areas */
     if (qemu_ram_foreach_migratable_block(ram_block_enable_notify, mis)) {
+        error_report("ram_block_enable_notify failed");
         return -1;
     }
 
index 9e45fb4f3f44d38fd51b2ee95639341e88840739..d784e8aa400637cc48167d2b8a6f6de10dda2870 100644 (file)
@@ -1729,6 +1729,7 @@ static int loadvm_postcopy_handle_listen(MigrationIncomingState *mis)
      */
     if (migrate_postcopy_ram()) {
         if (postcopy_ram_enable_notify(mis)) {
+            postcopy_ram_incoming_cleanup(mis);
             return -1;
         }
     }