summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2010-04-30 15:21:11 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2010-05-03 12:09:47 -0500
commit37905d6ae53d8a9f0744867a8cf2dad6e7ae3674 (patch)
tree814bd465f0f3d9f9355e320544452cb1c2946902
parent70a4568fe0c5a64adaa3da5030b7109e5199e692 (diff)
downloadfocaccia-qemu-37905d6ae53d8a9f0744867a8cf2dad6e7ae3674.tar.gz
focaccia-qemu-37905d6ae53d8a9f0744867a8cf2dad6e7ae3674.zip
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.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
--
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--vl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index 5e03b72f74..53ea69888d 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);