[Libguestfs] [PATCH] v2v: OVF: map CentOS as RHEL

Pino Toscano ptoscano at redhat.com
Tue Apr 3 16:22:55 UTC 2018


Since oVirt has no CentOS OS mappings, and that CentOS is derived from
RHEL, then map CentOS as RHEL for the OS.
---
 v2v/create_ovf.ml | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/v2v/create_ovf.ml b/v2v/create_ovf.ml
index 87245fdc8..64edd2b86 100644
--- a/v2v/create_ovf.ml
+++ b/v2v/create_ovf.ml
@@ -53,17 +53,17 @@ let iso_time =
 (* Guess vmtype based on the guest inspection data. *)
 let get_vmtype = function
   (* Special cases for RHEL 3 & RHEL 4. *)
-  | { i_type = "linux"; i_distro = "rhel"; i_major_version = (3|4);
+  | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = (3|4);
       i_product_name = product }
        when String.find product "ES" >= 0 ->
      `Server
 
-  | { i_type = "linux"; i_distro = "rhel"; i_major_version = (3|4);
+  | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = (3|4);
       i_product_name = product }
        when String.find product "AS" >= 0 ->
      `Server
 
-  | { i_type = "linux"; i_distro = "rhel"; i_major_version = (3|4) } ->
+  | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = (3|4) } ->
      `Desktop
 
   (* For Windows (and maybe Linux in future, but it is not set now),
@@ -89,19 +89,19 @@ let get_vmtype = function
  *   https://bugzilla.redhat.com/show_bug.cgi?id=1219857#c9
  *)
 and get_ostype = function
-  | { i_type = "linux"; i_distro = "rhel"; i_major_version = v;
+  | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = v;
       i_arch = "i386" } when v <= 6 ->
     sprintf "RHEL%d" v
 
-  | { i_type = "linux"; i_distro = "rhel"; i_major_version = v;
+  | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = v;
       i_arch = "x86_64" } when v <= 6 ->
     sprintf "RHEL%dx64" v
 
-  | { i_type = "linux"; i_distro = "rhel"; i_major_version = v;
+  | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = v;
       i_arch = "x86_64" } (* when v >= 7 *) ->
     sprintf "rhel_%dx64" v
 
-  | { i_type = "linux"; i_distro = "rhel"; i_major_version = 7;
+  | { i_type = "linux"; i_distro = ("rhel"|"centos"); i_major_version = 7;
       i_arch = "ppc64" | "ppc64le" } ->
     "rhel_7_ppc64"
 
-- 
2.14.3




More information about the Libguestfs mailing list