OSDN Git Service

vl.c: Create late backends before migration object
authorPeter Xu <peterx@redhat.com>
Wed, 19 Apr 2023 16:17:37 +0000 (12:17 -0400)
committerJuan Quintela <quintela@redhat.com>
Mon, 24 Apr 2023 09:29:01 +0000 (11:29 +0200)
The migration object may want to check against different types of memory
when initialized.  Delay the creation to be after late backends.

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
softmmu/vl.c

index 5cb72a5..fb6c221 100644 (file)
@@ -3584,13 +3584,18 @@ void qemu_init(int argc, char **argv)
     }
 
     /*
+     * Create backends before creating migration objects, so that it can
+     * check against compatibilities on the backend memories (e.g. postcopy
+     * over memory-backend-file objects).
+     */
+    qemu_create_late_backends();
+
+    /*
      * Note: creates a QOM object, must run only after global and
      * compat properties have been set up.
      */
     migration_object_init();
 
-    qemu_create_late_backends();
-
     /* parse features once if machine provides default cpu_type */
     current_machine->cpu_type = machine_class->default_cpu_type;
     if (cpu_option) {