Hello community,

here is the log from the commit of package virt-v2v for openSUSE:Factory 
checked in at 2015-09-13 09:45:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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        2015-07-22 
09:20:02.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.virt-v2v.new/virt-v2v.changes   2015-09-13 
09:45:34.000000000 +0200
@@ -1,0 +2,14 @@
+Fri Sep 11 02:58:45 UTC 2015 - [email protected]
+
+- Prevent 'uninitialized value $oldname' warnings if network name
+  is not defined (bsc#939542).
+  check_net_oldname.patch
+- Support conversions of domains using direct (macvtap) network
+  configurations. Automatic remapping is only possible through the
+  --network or --bridge parameter.
+  support_macvtap_networks.patch
+- Change 'ExclusiveArch' to x86_64 as Xen sources are x86_64 only,
+  and the target running virt-v2v must be the same arch (remote
+  targets are not supported).
+
+-------------------------------------------------------------------

New:
----
  check_net_oldname.patch
  support_macvtap_networks.patch

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

Other differences:
------------------
++++++ virt-v2v.spec ++++++
--- /var/tmp/diff_new_pack.u49pa2/_old  2015-09-13 09:45:35.000000000 +0200
+++ /var/tmp/diff_new_pack.u49pa2/_new  2015-09-13 09:45:35.000000000 +0200
@@ -44,6 +44,8 @@
 Patch15:        support_any_opensuse_ver.patch
 Patch16:        use_x86_64_for_i586.patch
 Patch17:        handle_existing_storage.patch
+Patch18:        check_net_oldname.patch
+Patch19:        support_macvtap_networks.patch
 Patch50:        meta_license_to_list.patch
 Patch99:        remove_esx_examples.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -58,7 +60,7 @@
 # Unfortunately, despite really being noarch, we have to make virt-v2v arch
 # dependent to avoid build failures on architectures where libguestfs isn't
 # available.
-ExclusiveArch:  x86_64 ppc64 ppc64le s390x
+ExclusiveArch:  x86_64
 
 # Build system direct requirements
 BuildRequires:  gettext
@@ -170,6 +172,8 @@
 %patch15 -p1
 %patch16 -p1
 %patch17 -p1
+%patch18 -p1
+%patch19 -p1
 # Apply meta_license_to_list.patch only for versions > SLES12
 %if 0%{?suse_version} >= 1320
 %patch50 -p1

++++++ check_net_oldname.patch ++++++
In some network configurations (e.g. macvtap), it is possible to see the
following error during the conversion:

 Use of uninitialized value $oldname in concatenation (.) or string at
 /usr/lib/perl5/vendor_perl/5.18.2/Sys/VirtConvert/Config.pm line 489.

Prevent the error by ensure $oldname and $oldtype are defined before
attempting to use them.

Index: virt-v2v-0.9.1/lib/Sys/VirtConvert/Config.pm
===================================================================
--- virt-v2v-0.9.1.orig/lib/Sys/VirtConvert/Config.pm
+++ virt-v2v-0.9.1/lib/Sys/VirtConvert/Config.pm
@@ -486,10 +486,12 @@ sub map_network
 
     my $mapping;
     foreach my $root (@search) {
-        ($mapping) = $root->findnodes
-            ("network[\@type='$oldtype' and \@name='$oldname']/network");
+        if (defined($oldtype) && defined($oldname)) {
+            ($mapping) = $root->findnodes
+                ("network[\@type='$oldtype' and \@name='$oldname']/network");
 
-        last if defined($mapping);
+            last if defined($mapping);
+        }
     }
 
     unless (defined($mapping)) {
++++++ support_macvtap_networks.patch ++++++
Support network configurations such as:

 <interface type='direct'>
   <mac address='f0:de:f1:9b:42:af'/>
   <source dev='eth0' mode='bridge'/>
   <model type='rtl8139'/>
   <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
 </interface>

which should be converted to:

 <interface type='direct'>
   <mac address='f0:de:f1:9b:42:af'/>
   <source dev='eth0' mode='bridge'/>
   <model type='virtio'/>
   <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
 </interface>

It is not possible to map this to another network through the virt-v2v
configuration file, or to validate that the interface works on the target.
Remapping during conversion can be done through the --network or --bridge
parameters.


Index: virt-v2v-0.9.1/lib/Sys/VirtConvert/Connection/LibVirt.pm
===================================================================
--- virt-v2v-0.9.1.orig/lib/Sys/VirtConvert/Connection/LibVirt.pm
+++ virt-v2v-0.9.1/lib/Sys/VirtConvert/Connection/LibVirt.pm
@@ -225,6 +225,13 @@ sub _parse_dom
         $info{mac} = _node_val($nic, 'mac/@address');
         $info{vnet} = _node_val($nic, 'source/@network | source/@bridge');
         $info{vnet_type} = _node_val($nic, '@type');
+        if (($info{vnet_type} eq 'direct') && (!defined($info{vnet}))) {
+            my ($source) = $root->findnodes('devices/interface/source');
+            if (defined($source)) {
+                $info{vnet_source}->{dev} = _node_val($source, '@dev');
+                $info{vnet_source}->{mode} = _node_val($source, '@mode');
+            }
+        }
 
         push(@{$meta{nics}}, \%info);
     }
Index: virt-v2v-0.9.1/lib/Sys/VirtConvert/Connection/LibVirtTarget.pm
===================================================================
--- virt-v2v-0.9.1.orig/lib/Sys/VirtConvert/Connection/LibVirtTarget.pm
+++ virt-v2v-0.9.1/lib/Sys/VirtConvert/Connection/LibVirtTarget.pm
@@ -490,7 +490,12 @@ DOM
         $mac->setAttribute('address', $nic->{mac});
 
         my $source = _append_elem($interface, 'source');
-        $source->setAttribute($vnet_type, $vnet);
+        if (!defined($vnet)) {
+            $source->setAttribute('dev', $nic->{vnet_source}->{dev});
+            $source->setAttribute('mode', $nic->{vnet_source}->{mode});
+        } else {
+            $source->setAttribute($vnet_type, $vnet);
+        }
 
         my $model = _append_elem($interface, 'model');
         $model->setAttribute('type', $guestcaps->{net});
Index: virt-v2v-0.9.1/lib/Sys/VirtConvert/Config.pm
===================================================================
--- virt-v2v-0.9.1.orig/lib/Sys/VirtConvert/Config.pm
+++ virt-v2v-0.9.1/lib/Sys/VirtConvert/Config.pm
@@ -499,10 +499,20 @@ sub map_network
         return @{$self->{default_net_mapping}}
             if (defined($self->{default_net_mapping}));
 
-        logmsg WARN, __x('No mapping found for "network type=\'{type}\' '.
+        if (($oldtype eq 'direct') && (!defined($oldname))) {
+
+            logmsg WARN, __x('No mapping possible for network type=\'{type}\''.
+                         ' Verify network interface configuration or use '.
+                         '\'--network\' or \'--bridge\' parameter to remap '.
+                         'network during conversion.', type => $oldtype);
+        } else {
+
+            logmsg WARN, __x('No mapping found for "network type=\'{type}\' '.
                          'name=\'{name}\'" in config file. The converted '.
                          'guest may not start until its network interface '.
                          'is updated.', type => $oldtype, name => $oldname);
+        }
+
         return;
     }
 

Reply via email to