diff mbox series

[XEN,v14,1/8] tools: Add vga=vmware

Message ID 34a50dc69e4c5722597e02a4df4e3da6d6586ec7.1597854907.git.don.slutz@gmail.com (mailing list archive)
State New, archived
Headers show
Series Xen VMware tools support | expand

Commit Message

Don Slutz Aug. 19, 2020, 4:51 p.m. UTC
From: Don Slutz <dslutz@verizon.com>

This allows use of QEMU's VMware emulated video card

NOTE: vga=vmware is not supported by device_model_version=qemu-xen-traditional

Signed-off-by: Don Slutz <dslutz@verizon.com>
CC: Don Slutz <don.slutz@gmail.com>
---
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

v14:
  Reworked to current code.
  Added below --- Reviewed-by: Konrad Rzeszutek 

v13:
  Added Acked-by: Ian Campbell

v12:
  Dropped LIBXL_HAVE_LIBXL_VGA_INTERFACE_TYPE_VMWARE
  This means that the later patch that defines LIBXL_HAVE_VMWARE
  is now also required.

v11:
  Dropped support for Qemu-trad.
  Also changed later patchs to not need this one.

v10: New at v10.

  Was part of "tools: Add vmware_hwver support"


 docs/man/xl.cfg.5.pod.in    | 4 +++-
 tools/libxl/libxl_dm.c      | 9 +++++++++
 tools/libxl/libxl_types.idl | 1 +
 tools/xl/xl_parse.c         | 2 ++
 4 files changed, 15 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 0532739..a9eae96 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -2396,7 +2396,7 @@  B<This option is deprecated, use vga="stdvga" instead>.
 =item B<vga="STRING">
 
 Selects the emulated video card.
-Options are: B<none>, B<stdvga>, B<cirrus> and B<qxl>.
+Options are: B<none>, B<stdvga>, B<cirrus>, B<vmware> and B<qxl>.
 The default is B<cirrus>.
 
 In general, QXL should work with the Spice remote display protocol
@@ -2404,6 +2404,8 @@  for acceleration, and a QXL driver is necessary in the guest in that case.
 QXL can also work with the VNC protocol, but it will be like a standard
 VGA card without acceleration.
 
+NOTE: B<vmware> is not supported on B<device_model_version = "qemu-xen-traditional">
+
 =item B<vnc=BOOLEAN>
 
 Allow access to the display via the VNC protocol.  This enables the
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index f2dc569..415c12e 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -808,6 +808,10 @@  static int libxl__build_device_model_args_old(libxl__gc *gc,
         case LIBXL_VGA_INTERFACE_TYPE_NONE:
             flexarray_append_pair(dm_args, "-vga", "none");
             break;
+        case LIBXL_VGA_INTERFACE_TYPE_VMWARE:
+            LOG(ERROR, "vga=vmware is not supported by "
+                "qemu-xen-traditional");
+            return ERROR_INVAL;
         case LIBXL_VGA_INTERFACE_TYPE_QXL:
             break;
         default:
@@ -1446,6 +1450,11 @@  static int libxl__build_device_model_args_new(libxl__gc *gc,
                 GCSPRINTF("qxl-vga,vram_size_mb=%"PRIu64",ram_size_mb=%"PRIu64,
                 (b_info->video_memkb/2/1024), (b_info->video_memkb/2/1024) ) );
             break;
+        case LIBXL_VGA_INTERFACE_TYPE_VMWARE:
+            flexarray_append_pair(dm_args, "-device",
+                GCSPRINTF("vmware-svga,vgamem_mb=%d",
+                libxl__sizekb_to_mb(b_info->video_memkb)));
+            break;
         default:
             LOGD(ERROR, guest_domid, "Invalid emulated video card specified");
             return ERROR_INVAL;
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 9d3f05f..36350d2 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -220,6 +220,7 @@  libxl_vga_interface_type = Enumeration("vga_interface_type", [
     (2, "STD"),
     (3, "NONE"),
     (4, "QXL"),
+    (5, "VMWARE"),
     ], init_val = "LIBXL_VGA_INTERFACE_TYPE_UNKNOWN")
 
 libxl_vendor_device = Enumeration("vendor_device", [
diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index 61b4ef7..c74a9e3 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -2590,6 +2590,8 @@  skip_usbdev:
                 b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_NONE;
             } else if (!strcmp(buf, "qxl")) {
                 b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_QXL;
+            } else if (!strcmp(buf, "vmware")) {
+                b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_VMWARE;
             } else {
                 fprintf(stderr, "Unknown vga \"%s\" specified\n", buf);
                 exit(1);