From 9dfe0bab607d6781b13254b31b5e6aad381c2f98 Mon Sep 17 00:00:00 2001 From: Alex Williamson Date: Wed, 5 May 2010 16:19:59 -0300 Subject: [PATCH 3/9] Fix boot once option RH-Author: Alex Williamson Message-id: <1273076399.2616.36.camel@localhost> Patchwork-id: 9051 O-Subject: [RHEL-6 qemu-kvm PATCH] Fix boot once option Bugzilla: 579692 RH-Acked-by: Kevin Wolf RH-Acked-by: Jes Sorensen RH-Acked-by: Juan Quintela Bugzilla: 579692 Upstream commit: 37905d6ae53d8a9f0744867a8cf2dad6e7ae3674 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 Signed-off-by: Anthony Liguori --- vl.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) Signed-off-by: Eduardo Habkost --- vl.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/vl.c b/vl.c index a01308a..45f4514 100644 --- a/vl.c +++ b/vl.c @@ -2598,6 +2598,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.7.0.3