Hello community,

here is the log from the commit of package virt-v2v for openSUSE:Factory 
checked in at 2014-01-10 21:23:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/virt-v2v (Old)
 and      /work/SRC/openSUSE:Factory/.virt-v2v.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "virt-v2v"

Changes:
--------
--- /work/SRC/openSUSE:Factory/virt-v2v/virt-v2v.changes        2014-01-02 
11:15:33.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.virt-v2v.new/virt-v2v.changes   2014-01-10 
21:23:06.000000000 +0100
@@ -1,0 +2,8 @@
+Thu Jan  9 23:59:17 UTC 2014 - [email protected]
+
+- Updated Windows conversion code to support VMDP installation through
+  RunOnce or RHSrvAny service. Virtio drivers are all installed if found
+  on target host (in /usr/share/virtio-win). 
+ * win_convert_on_suse.patch
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ virt-v2v.spec ++++++
--- /var/tmp/diff_new_pack.OA2VXj/_old  2014-01-10 21:23:06.000000000 +0100
+++ /var/tmp/diff_new_pack.OA2VXj/_new  2014-01-10 21:23:06.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package virt-v2v
 #
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -104,6 +104,13 @@
 Requires:       perl-XML-DOM-XPath >= 0.14
 Requires:       perl-XML-XPathEngine >= 0.13
 
+# For building rhsrvany
+#BuildRequires:  autoconf
+#BuildRequires:  automake
+#BuildRequires:  mingw32-cross-gcc
+#BuildRequires:  mingw32-filesystem
+#BuildRequires:  mingw32-gcc
+
 %description
 virt-v2v is a tool for converting and importing virtual machines to
 libvirt-managed KVM, or Red Hat Enterprise Virtualization. It can import a
@@ -122,6 +129,7 @@
 %build
 %{__perl} Build.PL
 ./Build
+#./Build rhsrvany
 
 # perl doesn't need debuginfo
 %define debug_package %{nil}
@@ -142,8 +150,9 @@
 windir=$statedir/software/windows
 mkdir -p $windir
 
-# Not yet required for SUSE
-#cp windows/rhsrvany.exe windows/firstboot.bat $windir/
+# Copy built rhsrvany.exe into place. There's no need for it to be executable
+#cp rhsrvany/RHSrvAny/rhsrvany.exe $windir/
+#chmod 0644 $windir/rhsrvany.exe
 
 mkdir -p %{buildroot}%{_sysconfdir}
 cp v2v/virt-v2v.conf %{buildroot}%{_sysconfdir}/

++++++ win_convert_on_suse.patch ++++++
--- /var/tmp/diff_new_pack.OA2VXj/_old  2014-01-10 21:23:06.000000000 +0100
+++ /var/tmp/diff_new_pack.OA2VXj/_new  2014-01-10 21:23:06.000000000 +0100
@@ -1,15 +1,21 @@
 In order to convert Windows guests on a SUSE host, several modifications are
 required to support the VMDP.
 
----
- lib/Sys/VirtConvert/Converter/Windows.pm |  160 
++++++++++---------------------
- v2v/virt-v2v.db                          |   14 +-
- 2 files changed, 61 insertions(+), 113 deletions(-)
+ lib/Sys/VirtConvert/Converter/Windows.pm |  301 
+++++++++++++++++--------------
+ v2v/virt-v2v.db                          |   27 ++
+ 2 files changed, 194 insertions(+), 134 deletions(-)
 
 diff -Nurp a/lib/Sys/VirtConvert/Converter/Windows.pm 
b/lib/Sys/VirtConvert/Converter/Windows.pm
 --- a/lib/Sys/VirtConvert/Converter/Windows.pm 2013-12-16 14:14:29.352268302 
-0700
-+++ b/lib/Sys/VirtConvert/Converter/Windows.pm 2013-12-16 14:15:12.499251060 
-0700
-@@ -53,7 +53,7 @@ Sys::VirtConvert::Converter::Windows - P
++++ b/lib/Sys/VirtConvert/Converter/Windows.pm 2014-01-09 16:53:53.159607751 
-0700
+@@ -1,5 +1,6 @@
+ # Sys::VirtConvert::Converter::Windows
+ # Copyright (C) 2009-2012 Red Hat Inc.
++# Copyright (C) 2013 SUSE Inc.
+ #
+ # This library is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU Lesser General Public
+@@ -53,7 +54,7 @@ Sys::VirtConvert::Converter::Windows - P
  Sys::VirtConvert::Converter::Windows does the "pre-conversion" steps
  required to get a Windows guest to boot on KVM.  Unlike the associated
  L<Sys::VirtConvert::Converter::Linux(3)> module, this doesn't do a full
@@ -18,16 +24,64 @@
  virtio block) driver, so that the Windows guest will be able to boot
  on the target.  A "RunOnce" script is also added to the VM which does
  all the rest of the conversion the first time the Windows VM is booted
-@@ -143,7 +143,7 @@ sub convert
-         _configure_firstboot($g, $root, $config, $tmpdir, $h_sys, 
$current_cs);
+@@ -137,21 +138,42 @@ sub convert
+     my $current_cs = $h_sys->node_get_value($select, 'Current');
+     $current_cs = sprintf("ControlSet%03i", $h_sys->value_dword($current_cs));
+ 
+-    # Initialise firstboot
+-    # N.B. This may fail, and $firstboot will be undef
+-    my ($firstboot, $firstboot_tmp, $firstboot_dir) =
+-        _configure_firstboot($g, $root, $config, $tmpdir, $h_sys, 
$current_cs);
++    # Check if vmdp is installed, as virtio drivers are only installed as a
++    # replacement for existing Xen PV drivers
++    my $block;
++    my $net;
++    if (_vmdp_installed($g, $h_soft)) {
++
++        # Initialise firstboot
++        # N.B. This may fail, and $firstboot will be undef
++        my ($firstboot, $firstboot_tmp, $firstboot_dir) =
++            _configure_firstboot($g, $root, $config, $tmpdir,
++                                 $h_sys, $h_soft, $current_cs);
++
++        _unconfigure_xenpv($g, $h_soft, $firstboot);
++
++        _close_firstboot($g, $firstboot, $firstboot_tmp, $firstboot_dir);
++
++        _disable_services($h_sys, $current_cs);
++
++        ($block, $net) =
++            _prepare_virtio_drivers($g, $root, $windir, $config,
++                                    $h_sys, $h_soft, $current_cs);
  
-     _configure_rhev_apt($g, $root, $config, $firstboot, $firstboot_dir);
+-    _configure_rhev_apt($g, $root, $config, $firstboot, $firstboot_dir);
 -    _unconfigure_xenpv($g, $h_soft, $firstboot);
-+    _unconfigure_xenpv($g, $h_sys, $firstboot);
- 
-     _close_firstboot($g, $firstboot, $firstboot_tmp, $firstboot_dir);
- 
-@@ -202,55 +202,66 @@ sub _download_hive
+-
+-    _close_firstboot($g, $firstboot, $firstboot_tmp, $firstboot_dir);
+-
+-    _disable_services($h_sys, $current_cs);
+-
+-    my ($block, $net) =
+-        _prepare_virtio_drivers($g, $root, $windir, $config,
+-                                $h_sys, $h_soft, $current_cs);
++    } else {
++        $block = 'ide';
++        $net   = 'rtl8139';
++        logmsg WARN, __x('The Virtual Machine Driver Pack (VMDP) was not '.
++                         'detected.  The guest will be configured with a '.
++                         '{block} block storage adapter and a {net} '.
++                         'network adapter, but no drivers will be installed '.
++                         'for them. If the {block} driver is not already '.
++                         'installed in the guest, it will fail to boot. '.
++                         'If the {net} driver is not already installed in '.
++                         'the guest, you must install it manually after '.
++                         'conversion.',
++                         block => $block, net => $net);
++    }
+ 
+     # Commit and upload the modified registry hives
+     $h_sys->commit(undef); undef $h_sys;
+@@ -202,52 +224,52 @@ sub _download_hive
  }
  
  # See 
http://rwmj.wordpress.com/2010/04/30/tip-install-a-device-driver-in-a-windows-vm/
@@ -92,22 +146,45 @@
  "0"="PCI\\\\VEN_1AF4&DEV_1001&SUBSYS_00021AF4&REV_00\\\\3&13c0b0c5&0&20"
  "Count"=dword:00000001
  "NextInstance"=dword:00000001
-+
-+;Remove the following legacy Xen keys:
-+[-HKEY_LOCAL_MACHINE\\SYSTEM\\$current_cs\\Enum\\Root\\LEGACY_XENBLK]
-+
-+[-HKEY_LOCAL_MACHINE\\SYSTEM\\$current_cs\\Enum\\Root\\LEGACY_XENSCSI]
-+
-+[-HKEY_LOCAL_MACHINE\\SYSTEM\\$current_cs\\Services\\XenBlk\\Enum]
-+
-+[-HKEY_LOCAL_MACHINE\\SYSTEM\\$current_cs\\Services\\XenScsi\\Enum]
-+
-+[HKEY_LOCAL_MACHINE\\SYSTEM\\$current_cs\\Services\\MIKE-NEWREG]
- REGEDITS
+@@ -283,8 +305,8 @@ sub _prepare_virtio_drivers
+     my ($g, $root, $windir, $config, $h_sys, $h_soft, $current_cs) = @_;
+ 
+     # Copy the target VirtIO drivers to the guest
+-    my $driverdir = File::Spec->catdir($g->case_sensitive_path($windir),
+-                                       'Drivers', 'VirtIO');
++    my $driverdir = File::Spec->catdir($g->case_sensitive_path('/Program 
Files'),
++                                       'vmdp', 'virtio');
  
-     my $io;
-@@ -321,7 +332,7 @@ sub _prepare_virtio_drivers
-         unless (defined($virtio_host) && $g->exists($virtio_guest));
+     $g->mkdir_p($driverdir);
+ 
+@@ -312,16 +334,27 @@ sub _prepare_virtio_drivers
+         return ($block, $net);
+     }
+ 
+-    # We can't proceed if there are any files missing
++    # We can't install any drivers if the defined virtio path is missing
+     my $virtio_guest = $config->get_transfer_path($virtio_host);
+-    v2vdie __x('Installation failed because the following '.
+-               'files referenced in the configuration file are '.
+-               'required, but missing: {list}',
+-               list => $virtio_host)
+-        unless (defined($virtio_host) && $g->exists($virtio_guest));
++    if (!(defined($virtio_host) && $g->exists($virtio_guest))) {
++        my $block = 'ide';
++        my $net   = 'rtl8139';
++
++        logmsg WARN, __x('The installation of virtio drivers failed because '.
++               'the driver path referenced in the configuration file '.
++               '({path}) is required, but missing. The guest will be '.
++               'configured with a {block} block storage adapter and a {net} '.
++               'network adapter, but no drivers will be installed for them. '.
++               'If the {block} driver is not already installed in the guest,'.
++               ' it will fail to boot. If the {net} driver is not already '.
++               'installed in the guest, you must install it manually after '.
++               'conversion.', path => $virtio_host, block => $block,
++               net => $net);
++        return ($block, $net);
++    }
  
      my ($block, $net);
 -    my $viostor_guest = File::Spec->catfile($virtio_guest, 'viostor.sys');
@@ -115,7 +192,21 @@
      if ($g->exists($viostor_guest)) {
          $block = 'virtio';
  
-@@ -342,7 +353,7 @@ sub _prepare_virtio_drivers
+@@ -329,7 +362,7 @@ sub _prepare_virtio_drivers
+         $g->cp($viostor_guest,
+                $g->case_sensitive_path("$windir/system32/drivers"));
+ 
+-        _add_viostor_to_registry($g, $root, $h_sys, $current_cs);
++        _add_virtio_blk_to_registry($g, $root, $h_sys, $current_cs);
+     } else {
+         $block = 'ide';
+         logmsg WARN, __x('There is no virtio block driver '.
+@@ -338,11 +371,11 @@ sub _prepare_virtio_drivers
+                          'configured with a {block} block storage '.
+                          'adapter, but no driver will be installed for '.
+                          'it. If the {block} driver is not already '.
+-                         'installed in the guest, it will fail to boot.'.
++                         'installed in the guest, it will fail to boot.',
                           block => $block);
      }
  
@@ -124,9 +215,43 @@
          $net = 'virtio';
      } else {
          $net = 'rtl8139';
-@@ -400,20 +411,20 @@ sub _configure_firstboot
+@@ -360,15 +393,28 @@ sub _prepare_virtio_drivers
+         $g->cp(File::Spec->catfile($virtio_guest, $file), $driverdir);
+     }
+ 
+-    # Find the node \Microsoft\Windows\CurrentVersion
++    # Add virtio installed key (to prevent removal when uninstalling Xen)
++    my $virtiopvd_installed = 0;
+     my $node = $h_soft->root();
++    $node = $h_soft->node_get_child($node, 'vmdp');
++    if (defined($node)) {
++        my $key = 'Virtio pvd Installed';
++        my $type = 4;
++        my $data = pack("L", 1);
++        my @new;
++        push (@new, { key => $key, t => $type, value => $data });
++        $h_soft->node_set_value($node, @new);
++    }
++
++    # Find the node \Microsoft\Windows\CurrentVersion
++    $node = $h_soft->root();
+     foreach ('Microsoft', 'Windows', 'CurrentVersion') {
+         $node = $h_soft->node_get_child($node, $_);
+     }
+ 
+     # Update DevicePath, but leave everything else as is
+     my @new;
+-    my $append = ';%SystemRoot%\Drivers\VirtIO';
++    my $append = ';%ProgramFiles%\vmdp\virtio';
+     foreach my $v ($h_soft->node_values($node)) {
+         my $key = $h_soft->value_key($v);
+         my ($type, $data) = $h_soft->value_value($v);
+@@ -398,25 +444,40 @@ sub _prepare_virtio_drivers
+ # Configure the guest to run a batch file on first boot
+ sub _configure_firstboot
  {
-     my ($g, $root, $config, $tmpdir, $h_sys, $current_cs) = @_;
+-    my ($g, $root, $config, $tmpdir, $h_sys, $current_cs) = @_;
++    my ($g, $root, $config, $tmpdir, $h_sys, $h_soft, $current_cs) = @_;
  
 -    # Ensure we have rhsrvany
 -    my ($rhsrvany_host) = $config->match_app($g, $root, 'rhsrvany',
@@ -143,6 +268,7 @@
  
 -    my $rhsrvany_guest = $config->get_transfer_path($rhsrvany_host);
 -    unless (defined($rhsrvany_guest) && $g->exists($rhsrvany_guest)) {
++    (my $vmdp_exe = $vmdp_host) =~ s/\S+\///;
 +    my $vmdp_guest = $config->get_transfer_path($vmdp_host);
 +    unless (defined($vmdp_guest) && $g->exists($vmdp_guest)) {
          logmsg WARN, __x('Unable to configure firstboot service because '.
@@ -152,7 +278,24 @@
          return undef;
      }
  
-@@ -433,6 +444,7 @@ sub _configure_firstboot
++    # If srvany exists, install using a service. If not, use RunOnce.
++    my $use_srvany = 0;
++    my ($srvany_host) = $config->match_app($g, $root, 'srvany',
++                                             $g->inspect_get_arch($root));
++    my $srvany_guest;
++    my $srvany_exe;
++    if (defined($srvany_host)) {
++        ($srvany_exe = $srvany_host) =~ s/\S+\///;
++        $srvany_guest = $config->get_transfer_path($srvany_host);
++        if (defined($srvany_guest) && $g->exists($srvany_guest)) {
++            $use_srvany = 1;
++        }
++    }
++
+     # Create a temporary local file to hold the firstboot batch file
+     my $firstboot_tmp = File::Spec->catfile($tmpdir, 'firstboot.bat');
+     my $firstboot;
+@@ -433,6 +494,7 @@ sub _configure_firstboot
  
  rem firstboot.bat
  rem Copyright (C) 2013 Red Hat Inc.
@@ -160,7 +303,14 @@
  rem
  rem This program is free software; you can redistribute it and/or
  rem modify it under the terms of the GNU Lesser General Public
-@@ -454,7 +466,7 @@ FIRSTBOOT
+@@ -447,14 +509,12 @@ rem
+ rem You should have received a copy of the GNU Lesser General Public
+ rem License along with this library; if not, write to the Free Software
+ rem Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
USA
+-
+-echo V2V first boot script started > log.txt
+ FIRSTBOOT
+ 
      # Create a directory for firstboot files in the guest
      my $firstboot_dir = ''; # global
      my $firstboot_dir_win = 'C:';
@@ -169,46 +319,102 @@
          $firstboot_dir .= '/'.$d;
          $firstboot_dir_win .= '\\\\'.$d;
  
-@@ -462,11 +474,11 @@ FIRSTBOOT
+@@ -462,19 +522,25 @@ FIRSTBOOT
          $g->mkdir_p($firstboot_dir);
      }
  
 -    # Copy rhsrvany to guest
 -    $g->cp($rhsrvany_guest, $firstboot_dir);
-+    # Copy vmdp-win to guest
-+    $g->cp($vmdp_guest, $firstboot_dir);
- 
+-
 -    # Add a new rhsrvany service to the system registry to execute firstboot
 -    my $rhsrvany_win = $firstboot_dir_win.'\\\\rhsrvany.exe';
-+    # Add a new vmdp service to the system registry to execute firstboot
-+    my $vmdp_win = $firstboot_dir_win.'\\\\VMDP-WIN-2.1.exe';
++    # Copy vmdp-win to guest
++    $g->cp($vmdp_guest, $firstboot_dir);
++    my $vmdp_win = $firstboot_dir_win.'\\\\'.$vmdp_exe;
      my $firstboot_win = $firstboot_dir_win.'\\\\firstboot.bat';
  
-     my $regedits = <<REGEDITS;
-@@ -474,7 +486,7 @@ FIRSTBOOT
+-    my $regedits = <<REGEDITS;
++    my $regedits;
++    if ($use_srvany == 1) {
++        # Copy srvany_guest to guest
++        $g->cp($srvany_guest, $firstboot_dir);
++
++        # Add a new srvany service to the system registry to execute firstboot
++        my $srvany_win = $firstboot_dir_win.'\\\\'.$srvany_exe;
++
++        $regedits = <<REGEDITS;
+ [HKEY_LOCAL_MACHINE\\SYSTEM\\$current_cs\\services\\v2v-firstboot]
  "Type"=dword:00000010
  "Start"=dword:00000002
  "ErrorControl"=dword:00000001
 -"ImagePath"="$rhsrvany_win -s v2v-firstboot"
-+"ImagePath"="$vmdp_win -s v2v-firstboot"
++"ImagePath"="$srvany_win -s v2v-firstboot"
  "DisplayName"="V2V first boot actions"
  "ObjectName"="LocalSystem"
  
-@@ -507,7 +519,7 @@ sub _close_firstboot
-     print $firstboot <<'FIRSTBOOT';
+@@ -482,19 +548,38 @@ FIRSTBOOT
+ "CommandLine"="cmd /c \\"$firstboot_win\\""
+ "PWD"="$firstboot_dir_win"
+ REGEDITS
+-
++    } else {
++        logmsg WARN, __x('Using RunOnce for firstboot. User login is '.
++                         'required for virtio driver installation, and Xen '.
++                         'PV driver uninstallation.');
++        $regedits = <<REGEDITS;
++[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce]
++"Virt-v2v"="$firstboot_win"
++REGEDITS
++    }
+     my $io = IO::String->new ($regedits);
+ 
+     local *_map = sub {
+         if ($_[0] =~ /^HKEY_LOCAL_MACHINE\\SYSTEM(.*)/i) {
+             return ($h_sys, $1);
++        } elsif ($_[0] =~ /^HKEY_LOCAL_MACHINE\\SOFTWARE(.*)/i) {
++            return ($h_soft, $1);
+         } else {
+-            die "can only make updates to the SYSTEM hive (key was: $_[0])\n"
++            die "can only make updates to the SYSTEM or SOFTWARE hives ".
++                "(key was: $_[0])\n"
+         }
+     };
+-
+     reg_import ($io, \&_map);
+ 
++    print $firstboot <<FIRSTBOOT;
++cd "$firstboot_dir_win"
++echo V2V first boot script started > log.txt
++echo Starting VMDP installation >> log.txt
++$vmdp_exe
++cd "VMDP-WIN*"
++setup.exe /eula_accepted >> ..\\log.txt
++cd ..
++FIRSTBOOT
+     return ($firstboot, $firstboot_tmp, $firstboot_dir);
+ }
+ 
+@@ -504,10 +589,10 @@ sub _close_firstboot
+ 
+     return unless defined($firstboot);
  
- echo uninstalling v2v-firstboot service >>log.txt
+-    print $firstboot <<'FIRSTBOOT';
++    print $firstboot <<FIRSTBOOT;
+ 
+-echo uninstalling v2v-firstboot service >>log.txt
 -rhsrvany.exe -s v2v-firstboot uninstall >>log.txt
-+vmdp-win.exe -s v2v-firstboot uninstall >>log.txt
++echo uninstalling v2v-firstboot service >> log.txt
++rhsrvany.exe -s v2v-firstboot uninstall >> log.txt
  FIRSTBOOT
  
      # Write the completed firstboot script into the guest
-@@ -517,90 +529,28 @@ FIRSTBOOT
+@@ -517,90 +602,46 @@ FIRSTBOOT
      }
  }
  
 -sub _configure_rhev_apt
--{
++sub _unconfigure_xenpv
+ {
 -    my ($g, $root, $config, $firstboot, $firstboot_dir) = @_;
 -
 -    # Ensure we have rhev-apt
@@ -227,65 +433,71 @@
 -                         path => $rhevapt_host);
 -        return;
 -    }
--
++    my ($g, $h_soft, $firstboot) = @_;
+ 
 -    # We can't install rhev-apt without firstboot
 -    # N.B. It may seem more efficient to check this first, but by checking it
 -    # here the user gets error messages for all missing files in a single
 -    # conversion
--    if (!defined($firstboot)) {
+     if (!defined($firstboot)) {
 -        logmsg WARN, __x('Unable to configure rhev-apt service without '.
--                         'firstboot');
--        return;
--    }
--
++        logmsg WARN, __x('Unable to uninstall Xen PV drivers without '.
+                          'firstboot');
+         return;
+     }
+ 
 -    $g->cp($rhevapt_guest, $firstboot_dir);
--
++    # Check again for Xenpvd, in the event the previous check is removed
++    if (_vmdp_installed($g, $h_soft)) {
++        # The uninstall program for the VMDP is hard coded to
++        # C:\Program Files\vmdp\uninstall.exe.
++        my $uninst = 'C:\Program Files\vmdp\uninstall.exe';
+ 
 -    print $firstboot <<'RHEVAPT';
--
++        print $firstboot <<FIRSTBOOT;
+ 
 -echo installing rhev-apt >>log.txt
 -"rhev-apt.exe" /S /v /qn >>log.txt
 -
 -echo starting rhev-apt >>log.txt
 -net start rhev-apt >>log.txt
 -RHEVAPT
--}
--
- sub _unconfigure_xenpv
++echo Uninstalling Xen PV driver >> log.txt
++"$uninst" /xen >> log.txt
++FIRSTBOOT
++    }
+ }
+ 
+-sub _unconfigure_xenpv
++sub _vmdp_installed
  {
 -    my ($g, $h_soft, $firstboot) = @_;
-+    my ($g, $h_sys, $firstboot) = @_;
++    my ($g, $h_soft) = @_;
++    my $xenpv_installed = 0;
  
 -    my @regkey = ('Microsoft', 'Windows', 'CurrentVersion', 'Uninstall',
 -                  'Red Hat Paravirtualized Xen Drivers for Windows(R)');
-+    my @regkey = ('Enum', 'Root');
- 
+-
 -    # Find the node \Microsoft\Windows\CurrentVersion\Uninstall
 -    #               \Red Hat Paravirtualized Xen Drivers for Windows(R)
--    my $node = $h_soft->root();
-+    my $rootnode = $h_sys->root();
-     foreach (@regkey) {
+     my $node = $h_soft->root();
+-    foreach (@regkey) {
 -        $node = $h_soft->node_get_child($node, $_);
 -        return unless defined($node);
-+        $rootnode = $h_sys->node_get_child($rootnode, $_);
-+        return unless defined($rootnode);
-     }
+-    }
++    $node = $h_soft->node_get_child($node, 'vmdp');
++    return unless defined($node);
  
 -    my $uninst;
--    foreach my $v ($h_soft->node_values($node)) {
--        my $key = $h_soft->value_key($v);
+     foreach my $v ($h_soft->node_values($node)) {
+         my $key = $h_soft->value_key($v);
 -
 -        if ($key eq 'UninstallString') {
 -            $uninst = $h_soft->value_value($v);
 -            $uninst = decode('UTF-16LE', $uninst);
 -            last;
-+    foreach ('LEGACY_XENBLK', 'LEGACY_XENSCSI') {
-+        my $node = $h_sys->node_get_child($rootnode, $_);
-+        if (defined($node)) {
-+            logmsg WARN, __x("FOUND the $_ node - $node");
-+            logmsg WARN, __x("DELETING the $_ node - $node");
-+            $h_sys->node_delete_child($node);
-+        } else {
-+            logmsg WARN, __x("DID not find $_ node");
++        if ($key eq 'Xenpvd Installed') {
++            $xenpv_installed = 1;
          }
      }
 -
@@ -304,12 +516,13 @@
 -echo Uninstalling Xen PV driver >>log.txt
 -"$uninst" >>log.txt
 -XENPV
++    return $xenpv_installed;
  }
  
  sub _disable_services
 diff -Nurp a/v2v/virt-v2v.db b/v2v/virt-v2v.db
 --- a/v2v/virt-v2v.db  2013-12-16 14:14:44.091262419 -0700
-+++ b/v2v/virt-v2v.db  2013-12-16 14:15:54.217234318 -0700
++++ b/v2v/virt-v2v.db  2014-01-09 16:05:29.123026860 -0700
 @@ -267,8 +267,9 @@ the modifications or additions to /etc/v
    <!-- Windows -->
  
@@ -322,19 +535,38 @@
    <app os='windows' major='5' minor='1' arch='i386' name='virtio'>
      <path>/usr/share/virtio-win/drivers/i386/WinXP</path>
    </app>
-@@ -285,12 +286,9 @@ the modifications or additions to /etc/v
+@@ -285,14 +286,32 @@ the modifications or additions to /etc/v
      <path>/usr/share/virtio-win/drivers/amd64/Win2008</path>
    </app>
  
 -  <!-- RHSrvAny is compiled as a 32 bit app even on 64 bit Windows -->
 -  <app os='windows' name='rhsrvany'>
--    <path>windows/rhsrvany.exe</path>
--  </app>
--  <app os='windows' name='rhev-apt'>
--    <path>windows/rhev-apt.exe</path>
-+  <!-- Virtual Machine Driver Pack (VMDP) setup program -->
-+  <app os='windows' name='vmdp-win'>
-+    <path>windows/VMDP-WIN-2.1.exe</path>
++  <!-- If available, Windows virtio drivers are installed by launching the
++       vendor provided virtio installation program. This install can be
++       started as a Windows service, or through the RunOnce capabilities of
++       Windows. The RunOnce method will execute the installation after a user
++       logs into Windows. To avoid the login requirement, an additional
++       utility is required. RHSrvAny is an open-source utility which allows
++       any program to run as a service under Windows. If available, virt-v2v
++       will use this program to install/uninstall virtio drivers as a service,
++       thereby avoiding the login requirement.
++
++       https://github.com/rwmjones/rhsrvany
++
++       To install through a service, compile the utility and copy it into the
++       /var/lib/virt-v2v/software/windows directory.  -->
++  <app os='windows' name='srvany'>
+     <path>windows/rhsrvany.exe</path>
+   </app>
+   <app os='windows' name='rhev-apt'>
+     <path>windows/rhev-apt.exe</path>
    </app>
  
++  <!-- SUSE Virtual Machine Driver Pack (VMDP) setup program -->
++  <app os='windows' name='vmdp-win'>
++    <path>windows/VMDP-WIN-2.1.exe</path>
++  </app>
++
    <!-- Default file locations -->
+   <path-root>/var/lib/virt-v2v/software</path-root>
+ </virt-v2v>

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to