[Libguestfs] [PATCH v2 1/4] appliance/init: Allow guestfs_noreboot=1 flag to avoid reboot at end of /init script.
Richard W.M. Jones
rjones at redhat.com
Fri Aug 9 21:51:00 UTC 2013
From: "Richard W.M. Jones" <rjones at redhat.com>
---
appliance/init | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/appliance/init b/appliance/init
index 681e59b..5e1fac4 100755
--- a/appliance/init
+++ b/appliance/init
@@ -171,4 +171,9 @@ else
fi
sync
-reboot -f
+
+if ! grep -sq guestfs_noreboot=1 /proc/cmdline; then
+ # qemu has the -no-reboot flag, so issuing a reboot here actually
+ # causes qemu to exit gracefully.
+ reboot -f
+fi
--
1.8.3.1
More information about the Libguestfs
mailing list