[Libguestfs] [PATCH] virt-v2v: Check for firstboot before unconfiguring XenPV

Mike Latimer mlatimer at suse.com
Fri Jan 3 20:37:57 UTC 2014


Although not fatal, _unconfigure_xenpv should report a warning and return
if firstboot is not available (during Windows conversions).

---
 lib/Sys/VirtConvert/Converter/Windows.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/Sys/VirtConvert/Converter/Windows.pm b/lib/Sys/VirtConvert/Converter/Windows.pm
index 59d273f..ce8b474 100644
--- a/lib/Sys/VirtConvert/Converter/Windows.pm
+++ b/lib/Sys/VirtConvert/Converter/Windows.pm
@@ -564,6 +564,12 @@ sub _unconfigure_xenpv
 {
     my ($g, $h_soft, $firstboot) = @_;
 
+    if (!defined($firstboot)) {
+        logmsg WARN, __x('Unable to uninstall Xen PV drivers without '.
+                         'firstboot');
+        return;
+    }
+
     my @regkey = ('Microsoft', 'Windows', 'CurrentVersion', 'Uninstall',
                   'Red Hat Paravirtualized Xen Drivers for Windows(R)');
 
-- 
1.8.1.4




More information about the Libguestfs mailing list