[Libguestfs] [virt-v2v wave 2 PATCH v2 08/16] lib/create_ovf: place a standard VGA video device in the OVF xml

Laszlo Ersek lersek at redhat.com
Thu Dec 2 09:46:29 UTC 2021


As of ovirt-engine commit daca2ca6cd91, ovirt-engine ignores

  <rasd:Device>qxl</rasd:Device>

entirely. That's mainly because

- the "rasd" namespace prefix selects the
  "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"
  namespace, and

- that namespace does not define a Device element.

Consequently, ovirt-engine picks the QXL device based on factors that are
unrelated to <rasd:Device>qxl</rasd:Device>, even now.

However, ovirt-engine does adhere to the plain <Device> element. Change
the element from <rasd:Device> to <Device>, and change its contents from
"qxl" to "vga", which ovirt-engine also recognizes already.

References:
- https://listman.redhat.com/archives/libguestfs/2021-November/msg00149.html
- https://bugzilla.redhat.com/show_bug.cgi?id=1976607#c3
- https://bugzilla.redhat.com/show_bug.cgi?id=1976607#c4
- https://listman.redhat.com/archives/libguestfs/2021-November/msg00218.html

Update: Liran is telling us that we should change the
"VirtualSystem/DefaultDisplayType" element as well, from 1 to 2.
Reference:
- https://bugzilla.redhat.com/show_bug.cgi?id=1961107#c39

Cc: Arik Hadas <ahadas at redhat.com>
Cc: Liran Rotenberg <lrotenbe at redhat.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1961107
Signed-off-by: Laszlo Ersek <lersek at redhat.com>
---

Notes:
    v2:
    
    - replace <rasd:Device> with <Device> [Arik, Liran]
    
    - change DefaultDisplayType to 2 [Liran]
    
    - update commit message
    
    v1:
    
    - new in v1

 lib/create_ovf.ml                          | 15 +++++++++------
 tests/test-v2v-o-rhv.ovf.expected          |  4 ++--
 tests/test-v2v-o-vdsm-options.ovf.expected |  4 ++--
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/lib/create_ovf.ml b/lib/create_ovf.ml
index 8c8ef43a42cd..c9f14635363e 100644
--- a/lib/create_ovf.ml
+++ b/lib/create_ovf.ml
@@ -587,8 +587,8 @@ let rec create_ovf source inspect
         e "TimeZone" [] [];
         e "IsStateless" [] [PCData "False"];
         e "VmType" [] [PCData vmtype];
-        (* See https://bugzilla.redhat.com/show_bug.cgi?id=1260590#c17 *)
-        e "DefaultDisplayType" [] [PCData "1"];
+        (* See https://bugzilla.redhat.com/show_bug.cgi?id=1961107#c39 *)
+        e "DefaultDisplayType" [] [PCData "2"];
       ] in
 
       (match biostype with
@@ -675,9 +675,12 @@ let rec create_ovf source inspect
           e "rasd:UsbPolicy" [] [PCData "Disabled"];
         ];
 
-        (* We always add a qxl device when outputting to RHV.
-         * See RHBZ#1213701 and RHBZ#1211231 for the reasoning
-         * behind that.
+        (* We always add a standard VGA-compatible video controller when
+         * outputting to RHV. See RHBZ#1213701 and RHBZ#1211231 for the
+         * reasoning behind that. The device model used to be QXL previously,
+         * but only the unaccelerated standard VGA framebuffer is needed; so
+         * the (simpler) standard VGA device itself suffices. Refer to
+         * RHBZ#1961107.
          *)
         let monitor_resourcetype =
           match ovf_flavour with
@@ -690,7 +693,7 @@ let rec create_ovf source inspect
             [PCData (string_of_int monitor_resourcetype)];
           e "Type" [] [PCData "video"];
           e "rasd:VirtualQuantity" [] [PCData "1"];
-          e "rasd:Device" [] [PCData "qxl"];
+          e "Device" [] [PCData "vga"];
         ]
       ];
 
diff --git a/tests/test-v2v-o-rhv.ovf.expected b/tests/test-v2v-o-rhv.ovf.expected
index f8aa07c45d4c..fe5d1c5b3fc2 100644
--- a/tests/test-v2v-o-rhv.ovf.expected
+++ b/tests/test-v2v-o-rhv.ovf.expected
@@ -24,7 +24,7 @@
     <TimeZone/>
     <IsStateless>False</IsStateless>
     <VmType>0</VmType>
-    <DefaultDisplayType>1</DefaultDisplayType>
+    <DefaultDisplayType>2</DefaultDisplayType>
     <BiosType>1</BiosType>
     <Section ovf:id='#VM_ID#' ovf:required='false' xsi:type='ovf:OperatingSystemSection_Type'>
       <Info>Microsoft Windows 7 Phony Edition</Info>
@@ -60,7 +60,7 @@
         <rasd:ResourceType>20</rasd:ResourceType>
         <Type>video</Type>
         <rasd:VirtualQuantity>1</rasd:VirtualQuantity>
-        <rasd:Device>qxl</rasd:Device>
+        <Device>vga</Device>
       </Item>
       <Item>
         <rasd:Caption>RNG Device</rasd:Caption>
diff --git a/tests/test-v2v-o-vdsm-options.ovf.expected b/tests/test-v2v-o-vdsm-options.ovf.expected
index f861071c08c3..ed177d57d9d3 100644
--- a/tests/test-v2v-o-vdsm-options.ovf.expected
+++ b/tests/test-v2v-o-vdsm-options.ovf.expected
@@ -24,7 +24,7 @@
     <TimeZone/>
     <IsStateless>False</IsStateless>
     <VmType>0</VmType>
-    <DefaultDisplayType>1</DefaultDisplayType>
+    <DefaultDisplayType>2</DefaultDisplayType>
     <BiosType>1</BiosType>
     <OperatingSystemSection ovf:id='VM' ovf:required='false' ovirt:id='11'>
       <Info>Microsoft Windows 7 Phony Edition</Info>
@@ -60,7 +60,7 @@
         <rasd:ResourceType>32768</rasd:ResourceType>
         <Type>video</Type>
         <rasd:VirtualQuantity>1</rasd:VirtualQuantity>
-        <rasd:Device>qxl</rasd:Device>
+        <Device>vga</Device>
       </Item>
       <Item>
         <rasd:Caption>RNG Device</rasd:Caption>
-- 
2.19.1.3.g30247aa5d201




More information about the Libguestfs mailing list