[Libguestfs] [virt-v2v RFC wave 2 07/10] convert/windows_virtio: flip default target display to Standard_VGA

Laszlo Ersek lersek at redhat.com
Mon Nov 1 17:06:15 UTC 2021


Policy change: if the requested guest caps do not express a preference for
any particular video type, pick Standard_VGA. In detail, this means the
following:

- If the subject Windows version is unsupported by virtio-win.iso (either
  entirely, or regarding just the QXL driver), then do not warn the user
  that we pick "something else than QXL".

  That's because we don't perceive Standard_VGA inferior to QXL.

- Pick Cirrus too only if specifically requested.

- Map the following patterns of the (rcaps.rcaps_video, has_qxl) tuple:

  - (None, false)
  - (None, true)

  to Standard_VGA. All six other patterns preserve their previous
  mappings.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1961107
Signed-off-by: Laszlo Ersek <lersek at redhat.com>
---

Notes:
    This patch breaks the following test cases:
    - test-v2v-o-glance.sh
    - test-v2v-o-json.sh
    - test-v2v-o-openstack.sh
    
    That's because we still have the initial "assert false" expressions for
    Standard_VGA in the OpenStack and JSON (... and OVF) producers, from
    patch 'lib/types: introduce "Standard_VGA" constructor for
    "guestcaps_video_type'.

 convert/windows_virtio.ml | 13 +++++--------
 tests/test-v2v-i-ova.xml  |  2 +-
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/convert/windows_virtio.ml b/convert/windows_virtio.ml
index ee887fa8f715..1a47a1500076 100644
--- a/convert/windows_virtio.ml
+++ b/convert/windows_virtio.ml
@@ -61,7 +61,7 @@ let rec install_drivers ((g, _) as reg) inspect rcaps =
     | { rcaps_block_bus = ((Some IDE | None) as block_type);
         rcaps_net_bus = ((Some E1000 | Some RTL8139 | None) as net_type);
         rcaps_video = ((Some Standard_VGA | Some Cirrus | None) as video_type) } ->
-      if block_type = None || net_type = None || video_type = None then
+      if block_type = None || net_type = None then
         warning (f_"there are no virtio drivers available for this version of Windows (%d.%d %s %s).  virt-v2v looks for drivers in %s\n\nThe guest will be configured to use slower emulated devices.")
                 inspect.i_major_version inspect.i_minor_version inspect.i_arch
                 inspect.i_product_variant virtio_win
@@ -73,7 +73,7 @@ let rec install_drivers ((g, _) as reg) inspect rcaps =
       and video_type =
         match video_type with
         | Some model -> model
-        | None -> Cirrus in
+        | None -> Standard_VGA in
       (IDE, net_type, video_type, false, false, false, false)
   )
   else (
@@ -170,13 +170,10 @@ let rec install_drivers ((g, _) as reg) inspect rcaps =
               inspect.i_major_version inspect.i_minor_version
               inspect.i_arch virtio_win
 
-      | None, false ->
-        warning (f_"there is no QXL driver for this version of Windows (%d.%d %s).  virt-v2v looks for this driver in %s\n\nThe guest will be configured to use a basic VGA display driver.")
-                inspect.i_major_version inspect.i_minor_version
-                inspect.i_arch virtio_win;
-        Cirrus
+      | None, _ ->
+        Standard_VGA
 
-      | (Some QXL | None), true ->
+      | Some QXL, true ->
         QXL
 
       | Some (Cirrus | Standard_VGA as video_type), _ ->
diff --git a/tests/test-v2v-i-ova.xml b/tests/test-v2v-i-ova.xml
index 30f52f557d9f..d7383905fdc0 100644
--- a/tests/test-v2v-i-ova.xml
+++ b/tests/test-v2v-i-ova.xml
@@ -39,7 +39,7 @@
       <model type='virtio'/>
     </interface>
     <video>
-      <model type='qxl' ram='65536' heads='1'/>
+      <model type='vga' vram='16384' heads='1'/>
     </video>
     <graphics type='vnc' autoport='yes' port='-1'/>
     <rng model='virtio'>
-- 
2.19.1.3.g30247aa5d201




More information about the Libguestfs mailing list