[virt-tools-list] [PATCH 1/5] virtinst: add --graphics gl option

Marc-André Lureau marcandre.lureau at redhat.com
Thu Feb 18 16:47:34 UTC 2016


From: Marc-André Lureau <marcandre.lureau at gmail.com>

Add a --graphics option to enable accelarated rendering using
OpenGl. This is used only by Spice (and for local only guests atm).

Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
---
 man/virt-install.pod                                     | 5 +++++
 tests/cli-test-xml/compare/virt-install-many-devices.xml | 3 +++
 tests/clitest.py                                         | 1 +
 tests/xmlparse-xml/change-graphics-out.xml               | 2 +-
 tests/xmlparse.py                                        | 1 +
 virtinst/cli.py                                          | 1 +
 virtinst/devicegraphics.py                               | 3 ++-
 7 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/man/virt-install.pod b/man/virt-install.pod
index 1f3f535..c5359de 100644
--- a/man/virt-install.pod
+++ b/man/virt-install.pod
@@ -982,6 +982,11 @@ Request a VNC password, required at connection time. Beware, this info may
 end up in virt-install log files, so don't use an important password. This
 is used by 'vnc' and 'spice'
 
+=item B<gl>
+
+Whether to use OpenGl accelerated rendering. Value is 'yes' or 'no'. This is
+used by 'spice'.
+
 =back
 
 Use --graphics=? to see a list of all available sub options. Complete details at L<http://libvirt.org/formatdomain.html#elementsGraphics>
diff --git a/tests/cli-test-xml/compare/virt-install-many-devices.xml b/tests/cli-test-xml/compare/virt-install-many-devices.xml
index b444d75..e0902ef 100644
--- a/tests/cli-test-xml/compare/virt-install-many-devices.xml
+++ b/tests/cli-test-xml/compare/virt-install-many-devices.xml
@@ -210,6 +210,9 @@
       <mouse mode="client"/>
       <filetransfer enable="yes"/>
     </graphics>
+    <graphics type="spice" gl="yes" port="-1" tlsPort="-1" autoport="yes">
+      <image compression="off"/>
+    </graphics>
     <serial type="tcp">
       <source mode="bind" host="127.0.0.1" service="2222"/>
       <protocol type="telnet"/>
diff --git a/tests/clitest.py b/tests/clitest.py
index e68f81d..9d357c7 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -476,6 +476,7 @@ c.add_compare(""" \
 --graphics vnc,port=5950,listen=1.2.3.4,keymap=ja,password=foo \
 --graphics spice,port=5950,tlsport=5950,listen=1.2.3.4,keymap=ja \
 --graphics spice,image_compression=foo,streaming_mode=bar,clipboard_copypaste=yes,mouse_mode=client,filetransfer_enable=on \
+--graphics spice,gl=yes \
 \
 --controller usb,model=ich9-ehci1,address=0:0:4.7,index=0 \
 --controller usb,model=ich9-uhci1,address=0:0:4.0,index=0,master=0 \
diff --git a/tests/xmlparse-xml/change-graphics-out.xml b/tests/xmlparse-xml/change-graphics-out.xml
index 8a58f9a..f6130de 100644
--- a/tests/xmlparse-xml/change-graphics-out.xml
+++ b/tests/xmlparse-xml/change-graphics-out.xml
@@ -31,7 +31,7 @@
     <graphics type="vnc" autoport="no">
       <listen type="network" network="mynewnet"/>
     </graphics>
-    <graphics type="spice" passwd="newpass" port="6000" tlsPort="6001" listen="1.2.3.4" passwdValidTo="2011-01-07T19:08:00" connected="disconnect" defaultMode="secure">
+    <graphics type="spice" passwd="newpass" port="6000" tlsPort="6001" listen="1.2.3.4" passwdValidTo="2011-01-07T19:08:00" gl="yes" connected="disconnect" defaultMode="secure">
       <listen type="address" address="1.2.3.4"/>
       <channel name="inputs" mode="secure"/>
       <channel name="main" mode="any"/>
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index b19f88c..2e41746 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -649,6 +649,7 @@ class XMLParseTest(unittest.TestCase):
         check("clipboard_copypaste", None, True)
         check("mouse_mode", None, "client")
         check("filetransfer_enable", None, False)
+        check("gl", None, True)
 
         self._alter_compare(guest.get_xml_config(), outfile)
 
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 475bfb4..898f803 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -1892,6 +1892,7 @@ class ParserGraphics(VirtCLIParser):
         self.set_param("mouse_mode", "mouse_mode")
         self.set_param("filetransfer_enable", "filetransfer_enable",
             is_onoff=True)
+        self.set_param("gl", "gl", is_onoff=True)
 
     def _parse(self, opts, inst):
         if opts.fullopts == "none":
diff --git a/virtinst/devicegraphics.py b/virtinst/devicegraphics.py
index d8d54dd..d44eca7 100644
--- a/virtinst/devicegraphics.py
+++ b/virtinst/devicegraphics.py
@@ -108,7 +108,7 @@ class VirtualGraphics(VirtualDevice):
         self._local_keymap = -1
 
 
-    _XML_PROP_ORDER = ["type", "port", "tlsPort", "autoport",
+    _XML_PROP_ORDER = ["type", "gl", "port", "tlsPort", "autoport",
                        "keymap", "listen",
                        "passwd", "display", "xauth"]
 
@@ -208,6 +208,7 @@ class VirtualGraphics(VirtualDevice):
     type = XMLProperty("./@type",
                        default_cb=lambda s: "vnc",
                        default_name="default")
+    gl = XMLProperty("./@gl", is_yesno=True)
     passwd = XMLProperty("./@passwd")
     passwdValidTo = XMLProperty("./@passwdValidTo")
     socket = XMLProperty("./@socket")
-- 
2.5.0




More information about the virt-tools-list mailing list