Blame SOURCES/0075-v2v-Disable-autoreboot-when-converting-Windows-guest.patch

0d20ef
From 745cb07a0d0090283383a35656bd0af36c446377 Mon Sep 17 00:00:00 2001
0d20ef
From: "Richard W.M. Jones" <rjones@redhat.com>
0d20ef
Date: Thu, 4 Dec 2014 09:12:27 +0000
0d20ef
Subject: [PATCH] v2v: Disable autoreboot when converting Windows guests.
0d20ef
0d20ef
This allows users to see stop errors, so we can get an accurate report
0d20ef
when things go wrong.
0d20ef
0d20ef
(cherry picked from commit 39d64121ec809076703b109053e12a3c91b9c2ea)
0d20ef
---
0d20ef
 v2v/convert_windows.ml | 12 ++++++++++++
0d20ef
 1 file changed, 12 insertions(+)
0d20ef
0d20ef
diff --git a/v2v/convert_windows.ml b/v2v/convert_windows.ml
0d20ef
index beca99c..1605a91 100644
0d20ef
--- a/v2v/convert_windows.ml
0d20ef
+++ b/v2v/convert_windows.ml
0d20ef
@@ -191,6 +191,7 @@ echo uninstalling Xen PV driver
0d20ef
     if verbose then printf "current ControlSet is %s\n%!" current_cs;
0d20ef
 
0d20ef
     disable_services root current_cs;
0d20ef
+    disable_autoreboot root current_cs;
0d20ef
     install_virtio_drivers root current_cs
0d20ef
 
0d20ef
   and disable_services root current_cs =
0d20ef
@@ -212,6 +213,17 @@ echo uninstalling Xen PV driver
0d20ef
         )
0d20ef
     ) disable
0d20ef
 
0d20ef
+  and disable_autoreboot root current_cs =
0d20ef
+    (* If the guest reboots after a crash, it's hard to see the original
0d20ef
+     * error (eg. the infamous 0x0000007B).  Turn off autoreboot.
0d20ef
+     *)
0d20ef
+    try
0d20ef
+      let crash_control =
0d20ef
+        get_node root [current_cs; "Control"; "CrashControl"] in
0d20ef
+      g#hivex_node_set_value crash_control "AutoReboot" 4_L (le32_of_int 0_L)
0d20ef
+    with
0d20ef
+      Not_found -> ()
0d20ef
+
0d20ef
   and install_virtio_drivers root current_cs =
0d20ef
     (* Copy the virtio drivers to the guest. *)
0d20ef
     let driverdir = sprintf "%s/Drivers/VirtIO" systemroot in
0d20ef
-- 
0d20ef
1.8.3.1
0d20ef