qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: arei.gonglei@huawei.com, qemu-devel@nongnu.org
Cc: dvaleev@suse.de, peter.huangpeng@huawei.com, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH 2/2] bootdevice: add check in restore_boot_order()
Date: Thu, 29 Jan 2015 17:03:55 +0100	[thread overview]
Message-ID: <54CA59EB.5040005@suse.de> (raw)
In-Reply-To: <1422538193-13648-3-git-send-email-arei.gonglei@huawei.com>



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

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	other threads:[~2015-01-29 16:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 13:29 [Qemu-devel] [PATCH 0/2] bootdevice: two little changes arei.gonglei
2015-01-29 13:29 ` [Qemu-devel] [PATCH 1/2] bootdevice: remove the check about boot_set_handler arei.gonglei
2015-01-29 16:03   ` Alexander Graf
2015-01-29 13:29 ` [Qemu-devel] [PATCH 2/2] bootdevice: add check in restore_boot_order() arei.gonglei
2015-01-29 16:03   ` Alexander Graf [this message]
2015-01-30  0:47     ` Gonglei
2015-01-30  7:46       ` Markus Armbruster
2015-01-30  8:20         ` Gonglei
2015-01-30 12:01           ` Markus Armbruster
2015-01-30 12:10             ` Gonglei
2015-01-30 12:32               ` Markus Armbruster
2015-01-30 12:43                 ` Gonglei
2015-02-02  9:37                   ` Markus Armbruster
2015-02-03  1:47                     ` Gonglei
2015-02-03  7:49                       ` Markus Armbruster
2015-02-03  8:52                         ` Gonglei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54CA59EB.5040005@suse.de \
    --to=agraf@suse.de \
    --cc=arei.gonglei@huawei.com \
    --cc=armbru@redhat.com \
    --cc=dvaleev@suse.de \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).