[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-arm] [PATCH 1/6] hw/arm/virt: Check that the CPU
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [Qemu-arm] [PATCH 1/6] hw/arm/virt: Check that the CPU realize method succeeded |
Date: |
Fri, 26 Jan 2018 11:32:13 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
On 12/07/2017 03:14 PM, Peter Maydell wrote:
> We were passing a NULL error pointer to the object_property_set_bool()
> call that realizes the CPU object. This meant that we wouldn't detect
> failure, and would plough blindly on to crash later trying to use a
> NULL CPU object pointer. Detect errors and fail instead.
>
> In particular, this will be necessary to detect the user error
> of using "-cpu host" without "-enable-kvm" once we make the host
> CPU type be registered unconditionally rather than only in
> kvm_arch_init().
>
> Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> hw/arm/virt.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 151592b..62af013 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -1402,7 +1402,7 @@ static void machvirt_init(MachineState *machine)
> "secure-memory", &error_abort);
> }
>
> - object_property_set_bool(cpuobj, true, "realized", NULL);
> + object_property_set_bool(cpuobj, true, "realized", &error_fatal);
> object_unref(cpuobj);
> }
> fdt_add_timer_nodes(vms);
>
- Re: [Qemu-devel] [Qemu-arm] [PATCH 1/6] hw/arm/virt: Check that the CPU realize method succeeded,
Philippe Mathieu-Daudé <=