Blob Blame History Raw
From 77604b91ec01ddd7961e69b70727b8e8c6e4c50b Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Fri, 13 Jul 2018 13:24:07 +0200
Subject: [PATCH] v2v: change QXL ResourceType in OVirt flavour (RHBZ#1598715)

Due to a conflict with the IDs of the OVF standard, and the existing
implementation in ovirt-engine, the ID of QXL devices changed to a
different value.

As a consequence, change the ResourceType of QXL devices, but only in
OVirt flavour to avoid breaking vdsm mode.

See: https://bugzilla.redhat.com/show_bug.cgi?id=1598715#c5
(cherry picked from commit aa9e18f6d1fd503822dfd2124b92a2c67704c4c1)
---
 v2v/create_ovf.ml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/v2v/create_ovf.ml b/v2v/create_ovf.ml
index 9e0c772fd..5db239d66 100644
--- a/v2v/create_ovf.ml
+++ b/v2v/create_ovf.ml
@@ -643,10 +643,14 @@ let rec create_ovf source targets guestcaps inspect
          * See RHBZ#1213701 and RHBZ#1211231 for the reasoning
          * behind that.
          *)
+        let qxl_resourcetype =
+          match ovf_flavour with
+          | OVirt -> 32768 (* RHBZ#1598715 *)
+          | RHVExportStorageDomain -> 20 in
         e "Item" [] [
           e "rasd:Caption" [] [PCData "Graphical Controller"];
           e "rasd:InstanceId" [] [PCData (uuidgen ())];
-          e "rasd:ResourceType" [] [PCData "20"];
+          e "rasd:ResourceType" [] [PCData (string_of_int qxl_resourcetype)];
           e "Type" [] [PCData "video"];
           e "rasd:VirtualQuantity" [] [PCData "1"];
           e "rasd:Device" [] [PCData "qxl"];
-- 
2.20.1