Skip to contentSkip to conversation

Fix boot once option

PATCH Applied Alex Williamson 2 participants 2 messages Apr 30, 2010 – May 3, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix boot once option

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.

--

vl.c +7 -0
index a485c58..2fabc7e 100644
@@ -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);
 
#1 lore raw
Quoted 7 lines · Alex Williamson

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.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 26 lines

--

vl.c +7 -0
index a485c58..2fabc7e 100644
@@ -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);