Blame SOURCES/0170-v2v-OVF-Fix-list-of-operating-system-variants-for-RH.patch

ffd6ed
From d3659622155fedf1669e09e8ca46a253481601e7 Mon Sep 17 00:00:00 2001
ffd6ed
From: "Richard W.M. Jones" <rjones@redhat.com>
ffd6ed
Date: Sun, 10 May 2015 16:12:33 +0100
ffd6ed
Subject: [PATCH] v2v: OVF: Fix list of operating system variants for RHEV >=
ffd6ed
 3.3 (RHBZ#1219857).
ffd6ed
ffd6ed
Since RHEV 3.3, OS variant names like "RHEL6x64" were deprecated and
ffd6ed
replaced by names like "rhel_6x64".  "RHEL7x64" was never valid, and
ffd6ed
we should have used "rhel_7x64".  "Windows2012R2x64" was also never
ffd6ed
valid and should have been "windows_2012R2x64".
ffd6ed
ffd6ed
For backwards compatibility, RHEV still understands the old names, and
ffd6ed
we still pass them for compatiblity with old RHEV.
ffd6ed
ffd6ed
However for the new OS variants supported by virt-v2v in RHEL 7.2, use
ffd6ed
the new names.
ffd6ed
ffd6ed
This commit also adds support for SLES and ppc64.
ffd6ed
ffd6ed
This updates commit 3c51302d691cc204e4d43f4ab9837095d424bf3b
ffd6ed
and also RHBZ#1213324.
ffd6ed
ffd6ed
(cherry picked from commit 6f9d5dce47f8502bee5d7285faf7695b22b5300b)
ffd6ed
---
ffd6ed
 v2v/OVF.ml | 32 +++++++++++++++++++++++++-------
ffd6ed
 1 file changed, 25 insertions(+), 7 deletions(-)
ffd6ed
ffd6ed
diff --git a/v2v/OVF.ml b/v2v/OVF.ml
ffd6ed
index 4a6ee8d..849bedd 100644
ffd6ed
--- a/v2v/OVF.ml
ffd6ed
+++ b/v2v/OVF.ml
ffd6ed
@@ -97,17 +97,35 @@ let get_vmtype = function
ffd6ed
 
ffd6ed
 (* Determine the ovf:OperatingSystemSection_Type from libguestfs
ffd6ed
  * inspection.  See ovirt-engine sources, file:
ffd6ed
- * frontend/webadmin/modules/uicompat/src/main/resources/org/ovirt/engine/ui/uicompat/Enums.properties
ffd6ed
+ *   packaging/conf/osinfo-defaults.properties
ffd6ed
+ * and also:
ffd6ed
+ *   https://bugzilla.redhat.com/show_bug.cgi?id=1219857#c9
ffd6ed
  *)
ffd6ed
 and get_ostype = function
ffd6ed
   | { i_type = "linux"; i_distro = "rhel"; i_major_version = v;
ffd6ed
-      i_arch = "i386" } ->
ffd6ed
+      i_arch = "i386" } when v <= 6 ->
ffd6ed
     sprintf "RHEL%d" v
ffd6ed
 
ffd6ed
   | { i_type = "linux"; i_distro = "rhel"; i_major_version = v;
ffd6ed
-      i_arch = "x86_64" } ->
ffd6ed
+      i_arch = "x86_64" } when v <= 6 ->
ffd6ed
     sprintf "RHEL%dx64" v
ffd6ed
 
ffd6ed
+  | { i_type = "linux"; i_distro = "rhel"; i_major_version = v;
ffd6ed
+      i_arch = "x86_64" } (* when v >= 7 *) ->
ffd6ed
+    sprintf "rhel_%dx64" v
ffd6ed
+
ffd6ed
+  | { i_type = "linux"; i_distro = "rhel"; i_major_version = 7;
ffd6ed
+      i_arch = "ppc64" | "ppc64le" } ->
ffd6ed
+    "rhel_7_ppc64"
ffd6ed
+
ffd6ed
+  | { i_type = "linux"; i_distro = "sles"; i_major_version = 11;
ffd6ed
+      i_arch = "x86_64" } ->
ffd6ed
+    "sles_11"
ffd6ed
+
ffd6ed
+  | { i_type = "linux"; i_distro = "sles"; i_major_version = 11;
ffd6ed
+      i_arch = "ppc64" | "ppc64le" } ->
ffd6ed
+    "sles_11_ppc64"
ffd6ed
+
ffd6ed
   | { i_type = "linux" } -> "OtherLinux"
ffd6ed
 
ffd6ed
   | { i_type = "windows"; i_major_version = 5; i_minor_version = 1 } ->
ffd6ed
@@ -147,19 +165,19 @@ and get_ostype = function
ffd6ed
 
ffd6ed
   | { i_type = "windows"; i_major_version = 6; i_minor_version = 2;
ffd6ed
       i_arch = "i386" } ->
ffd6ed
-    "Windows8"
ffd6ed
+    "windows_8"
ffd6ed
 
ffd6ed
   | { i_type = "windows"; i_major_version = 6; i_minor_version = 2;
ffd6ed
       i_arch = "x86_64"; i_product_variant = "Client" } ->
ffd6ed
-    "Windows8x64"
ffd6ed
+    "windows_8x64"
ffd6ed
 
ffd6ed
   | { i_type = "windows"; i_major_version = 6; i_minor_version = 2;
ffd6ed
       i_arch = "x86_64" } ->
ffd6ed
-    "Windows2012x64"
ffd6ed
+    "windows_2012x64"
ffd6ed
 
ffd6ed
   | { i_type = "windows"; i_major_version = 6; i_minor_version = 3;
ffd6ed
       i_arch = "x86_64" } ->
ffd6ed
-    "Windows2012R2x64"
ffd6ed
+    "windows_2012R2x64"
ffd6ed
 
ffd6ed
   | { i_type = typ; i_distro = distro;
ffd6ed
       i_major_version = major; i_minor_version = minor;
ffd6ed
-- 
ffd6ed
1.8.3.1
ffd6ed