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 - mlatimer@suse.com
+
+- 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
LSys::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-window...
@@ -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 = <