qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/2] bootdevice: add check in restore_boot_order


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH 2/2] bootdevice: add check in restore_boot_order()
Date: Thu, 29 Jan 2015 17:03:55 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.3.0


On 29.01.15 14:29, address@hidden wrote:
> From: Gonglei <address@hidden>
> 
> If boot order is invaild or is set failed,
> exit qemu.
> 
> Signed-off-by: Gonglei <address@hidden>

Do we really want to kill the machine only because the boot device
string doesn't validate?


Alex

> ---
>  bootdevice.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/bootdevice.c b/bootdevice.c
> index 52d3f9e..8d05b8d 100644
> --- a/bootdevice.c
> +++ b/bootdevice.c
> @@ -94,6 +94,7 @@ void restore_boot_order(void *opaque)
>  {
>      char *normal_boot_order = opaque;
>      static int first = 1;
> +    Error *local_err = NULL;
>  
>      /* Restore boot order and remove ourselves after the first boot */
>      if (first) {
> @@ -101,7 +102,12 @@ void restore_boot_order(void *opaque)
>          return;
>      }
>  
> -    qemu_boot_set(normal_boot_order, NULL);
> +    qemu_boot_set(normal_boot_order, &local_err);
> +    if (local_err) {
> +        error_report("%s", error_get_pretty(local_err));
> +        error_free(local_err);
> +        exit(1);
> +    }
>  
>      qemu_unregister_reset(restore_boot_order, normal_boot_order);
>      g_free(normal_boot_order);
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]