[Libguestfs] [virt-v2v wave 2 PATCH v2 02/16] output: handle Standard_VGA in the libvirt XML and QEMU cmdline formats

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


Libvirt domain XML fragment (with the default video RAM size made
explicit):

    <video>
      <model type='vga' vram='16384' heads='1'/>
    </video>

Example QEMU cmdline option:

  -vga std

References:
- https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/#VGA
- https://libvirt.org/formatdomain.html#video-devices

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

Notes:
    v2:
    
    - the libvirt output has been tested by Ming Xie <mxie at redhat.com> from
      RH QE in the meantime
      <https://bugzilla.redhat.com/show_bug.cgi?id=1961107#c24>
    
    v1:
    
    - no change
    
    RFC:
    
    - This is where further patches should be added for the OVF, JSON and
      OpenStack output modes.

 output/create_libvirt_xml.ml | 2 +-
 output/output.ml             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/output/create_libvirt_xml.ml b/output/create_libvirt_xml.ml
index ec1cd455ef13..623755de7212 100644
--- a/output/create_libvirt_xml.ml
+++ b/output/create_libvirt_xml.ml
@@ -421,7 +421,7 @@ let create_libvirt_xml ?pool source inspect
   let video =
     let video_model =
       match guestcaps.gcaps_video with
-      | Standard_VGA -> assert false
+      | Standard_VGA -> e "model" [ "type", "vga"; "vram", "16384" ] []
       | QXL ->    e "model" [ "type", "qxl"; "ram", "65536" ] []
       | Cirrus -> e "model" [ "type", "cirrus"; "vram", "9216" ] [] in
     append_attr ("heads", "1") video_model;
diff --git a/output/output.ml b/output/output.ml
index 1101d2cfc73d..7df90db33fa1 100644
--- a/output/output.ml
+++ b/output/output.ml
@@ -1540,7 +1540,7 @@ and qemu_finalize dir source inspect target_meta
       );
       arg "-vga"
         (match guestcaps.gcaps_video with
-         | Standard_VGA -> assert false
+         | Standard_VGA -> "std"
          | Cirrus -> "cirrus"
          | QXL -> "qxl"
         )
-- 
2.19.1.3.g30247aa5d201




More information about the Libguestfs mailing list