diff mbox

Fix boot once option

Message ID 1272662471.2822.9.camel@localhost
State New
Headers show

Commit Message

Alex Williamson April 30, 2010, 9:21 p.m. UTC
The boot once options seems to have gotten broken since it originally
went in.  We need to wait until the second time restore_boot_devices()
gets called before restoring the standard boot order and removing itself
from the reset list.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
--

Comments

Anthony Liguori May 3, 2010, 5:15 p.m. UTC | #1
On 04/30/2010 04:21 PM, Alex Williamson wrote:
> The boot once options seems to have gotten broken since it originally
> went in.  We need to wait until the second time restore_boot_devices()
> gets called before restoring the standard boot order and removing itself
> from the reset list.
>
> Signed-off-by: Alex Williamson<alex.williamson@redhat.com>
>    

Applied.  Thanks.

Regards,

Anthony Liguori
> --
>
> diff --git a/vl.c b/vl.c
> index a485c58..2fabc7e 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1193,6 +1193,13 @@ static void validate_bootdevices(char *devices)
>   static void restore_boot_devices(void *opaque)
>   {
>       char *standard_boot_devices = opaque;
> +    static int first = 1;
> +
> +    /* Restore boot order and remove ourselves after the first boot */
> +    if (first) {
> +        first = 0;
> +        return;
> +    }
>
>       qemu_boot_set(standard_boot_devices);
>
>
>
>
>
>
>
diff mbox

Patch

diff --git a/vl.c b/vl.c
index a485c58..2fabc7e 100644
--- a/vl.c
+++ b/vl.c
@@ -1193,6 +1193,13 @@  static void validate_bootdevices(char *devices)
 static void restore_boot_devices(void *opaque)
 {
     char *standard_boot_devices = opaque;
+    static int first = 1;
+
+    /* Restore boot order and remove ourselves after the first boot */
+    if (first) {
+        first = 0;
+        return;
+    }
 
     qemu_boot_set(standard_boot_devices);