diff mbox series

[v2,2/4] vl.c: Create late backends before migration object

Message ID 20230419161739.1129988-3-peterx@redhat.com (mailing list archive)
State New, archived
Headers show
Series migration/hostmem: Allow to fail early for postcopy on specific fs type | expand

Commit Message

Peter Xu April 19, 2023, 4:17 p.m. UTC
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>
---
 softmmu/vl.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

David Hildenbrand April 19, 2023, 4:31 p.m. UTC | #1
On 19.04.23 18:17, Peter Xu wrote:
> 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>
> ---
>   softmmu/vl.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/softmmu/vl.c b/softmmu/vl.c
> index ea20b23e4c..ad394b402f 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -3583,14 +3583,19 @@ void qemu_init(int argc, char **argv)
>                        machine_class->name, machine_class->deprecation_reason);
>       }
>   
> +    /*
> +     * 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) {

Reviewed-by: David Hildenbrand <david@redhat.com>
Juan Quintela April 19, 2023, 7:35 p.m. UTC | #2
Peter Xu <peterx@redhat.com> wrote:
> 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>

We are moving late to early, not the best name O:-)
diff mbox series

Patch

diff --git a/softmmu/vl.c b/softmmu/vl.c
index ea20b23e4c..ad394b402f 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3583,14 +3583,19 @@  void qemu_init(int argc, char **argv)
                      machine_class->name, machine_class->deprecation_reason);
     }
 
+    /*
+     * 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) {