[Libguestfs] [v2v PATCH] v2v: -o libvirt: write CentOS 8 osinfo ID

Pino Toscano ptoscano at redhat.com
Tue Dec 10 16:51:17 UTC 2019


CentOS 8 is represented with a simpler osinfo ID without a minor
version.
---
 v2v/create_libvirt_xml.ml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/v2v/create_libvirt_xml.ml b/v2v/create_libvirt_xml.ml
index dbc24315..002ce2b8 100644
--- a/v2v/create_libvirt_xml.ml
+++ b/v2v/create_libvirt_xml.ml
@@ -43,9 +43,14 @@ let get_osinfo_id = function
       i_major_version = major; i_minor_version = minor } when major < 7 ->
     Some (sprintf "http://centos.org/centos/%d.%d" major minor)
 
-  | { i_type = "linux"; i_distro = "centos"; i_major_version = major } ->
+  | { i_type = "linux"; i_distro = "centos"; i_major_version = major }
+    when major = 7 ->
     Some (sprintf "http://centos.org/centos/%d.0" major)
 
+  | { i_type = "linux"; i_distro = "centos"; i_major_version = major }
+    when major >= 8 ->
+    Some (sprintf "http://centos.org/centos/%d" major)
+
   | { i_type = "linux"; i_distro = "sles";
       i_major_version = major; i_minor_version = 0;
       i_product_name = product } when String.find product "Desktop" >= 0 ->
-- 
2.23.0




More information about the Libguestfs mailing list