[virt-tools-list] [PATCH v2 1/5] virtinst: add --graphics gl option
Marc-André Lureau
marcandre.lureau at redhat.com
Fri Mar 4 11:31:51 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 | 4 ++++
tests/clitest.py | 1 +
tests/xmlparse-xml/change-graphics-out.xml | 1 +
tests/xmlparse.py | 1 +
virtinst/cli.py | 1 +
virtinst/devicegraphics.py | 3 ++-
7 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/man/virt-install.pod b/man/virt-install.pod
index 4efe391..e2cd3a0 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..e771cd3 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,10 @@
<mouse mode="client"/>
<filetransfer enable="yes"/>
</graphics>
+ <graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
+ <gl enable="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..0c08458 100644
--- a/tests/xmlparse-xml/change-graphics-out.xml
+++ b/tests/xmlparse-xml/change-graphics-out.xml
@@ -39,6 +39,7 @@
<channel name="cursor" mode="any"/>
<channel name="playback" mode="insecure"/>
<channel name="display" mode="secure"/>
+ <gl enable="yes"/>
<image compression="auto_glz"/>
<streaming mode="filter"/>
<clipboard copypaste="yes"/>
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..c93a204 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"]
@@ -224,5 +224,6 @@ class VirtualGraphics(VirtualDevice):
clipboard_copypaste = XMLProperty("./clipboard/@copypaste", is_yesno=True)
mouse_mode = XMLProperty("./mouse/@mode")
filetransfer_enable = XMLProperty("./filetransfer/@enable", is_yesno=True)
+ gl = XMLProperty("./gl/@enable", is_yesno=True)
VirtualGraphics.register_type()
--
2.5.0
More information about the virt-tools-list
mailing list