[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 3/6] vl: Fix latent bug with -global and onb
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [RFC PATCH 3/6] vl: Fix latent bug with -global and onboard devices |
Date: |
Tue, 26 Feb 2019 13:45:13 +0100 |
On Mon, Feb 25, 2019 at 7:41 PM Markus Armbruster <address@hidden> wrote:
>
> main() registers the user's -global only after we create the machine
> object, i.e. too late for devices created in the machine's
> .instance_init().
>
> Fortunately, we know the bug is only latent: the commit before
> previous fixed a bug that would've crashed any attempt to create a
> device in an .instance_init().
>
> Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
> ---
> vl.c | 19 ++-----------------
> 1 file changed, 2 insertions(+), 17 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index c50c2d6178..e3fdce410f 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2939,17 +2939,6 @@ static void user_register_global_props(void)
> global_init_func, NULL, NULL);
> }
>
> -/*
> - * Note: we should see that these properties are actually having a
> - * priority: accel < machine < user. This means e.g. when user
> - * specifies something in "-global", it'll always be used with highest
> - * priority than either machine/accelerator compat properties.
> - */
> -static void register_global_properties(MachineState *ms)
> -{
> - user_register_global_props();
> -}
> -
> int main(int argc, char **argv, char **envp)
> {
> int i;
> @@ -3943,6 +3932,8 @@ int main(int argc, char **argv, char **envp)
> */
> loc_set_none();
>
> + user_register_global_props();
> +
> replay_configure(icount_opts);
>
> if (incoming && !preconfig_exit_requested) {
> @@ -4248,12 +4239,6 @@ int main(int argc, char **argv, char **envp)
> machine_class->name, machine_class->deprecation_reason);
> }
>
> - /*
> - * Register all the global properties, including accel properties,
> - * machine properties, and user-specified ones.
> - */
> - register_global_properties(current_machine);
> -
> /*
> * Migration object can only be created after global properties
> * are applied correctly.
> --
> 2.17.2
>
>
--
Marc-André Lureau
- [Qemu-devel] [RFC PATCH 0/6] pc: Support firmware configuration with -blockdev, Markus Armbruster, 2019/02/25
- [Qemu-devel] [RFC PATCH 4/6] sysbus: Fix latent bug with onboard devices, Markus Armbruster, 2019/02/25
- [Qemu-devel] [RFC PATCH 5/6] vl: Create block backends before setting machine properties, Markus Armbruster, 2019/02/25
- [Qemu-devel] [RFC PATCH 3/6] vl: Fix latent bug with -global and onboard devices, Markus Armbruster, 2019/02/25
- Re: [Qemu-devel] [RFC PATCH 3/6] vl: Fix latent bug with -global and onboard devices,
Marc-André Lureau <=
- [Qemu-devel] [RFC PATCH 1/6] qdev: Fix latent bug with compat_props and onboard devices, Markus Armbruster, 2019/02/25
- [Qemu-devel] [RFC PATCH 2/6] qom: Move compat_props machinery from qdev to QOM, Markus Armbruster, 2019/02/25
- [Qemu-devel] [RFC PATCH 6/6] pc: Support firmware configuration with -blockdev, Markus Armbruster, 2019/02/25