From dffb2aaa2de6c6819bc72a46d116919bcf2a6372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 21 Feb 2017 17:01:00 +0400 Subject: [PATCH] virtinst/cli: add spice rendernode argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau --- man/virt-install.pod | 4 ++++ tests/cli-test-xml/compare/virt-install-many-devices.xml | 5 +++++ tests/clitest.py | 1 + tests/xmlparse-xml/change-graphics-out.xml | 2 +- tests/xmlparse.py | 1 + virtinst/cli.py | 7 +++++++ virtinst/devicegraphics.py | 1 + virtinst/support.py | 2 ++ 8 files changed, 22 insertions(+), 1 deletion(-) diff --git a/man/virt-install.pod b/man/virt-install.pod index 27524f88b..7f3b52c50 100644 --- a/man/virt-install.pod +++ b/man/virt-install.pod @@ -1010,6 +1010,10 @@ is used by 'vnc' and 'spice' Whether to use OpenGl accelerated rendering. Value is 'yes' or 'no'. This is used by 'spice'. +=item B + +DRM render node path to use. This is used when 'gl' is enabled. + =back Use --graphics=? to see a list of all available sub options. Complete details at L 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 45010e0ef..345dd2700 100644 --- a/tests/cli-test-xml/compare/virt-install-many-devices.xml +++ b/tests/cli-test-xml/compare/virt-install-many-devices.xml @@ -246,6 +246,11 @@ + + + + + diff --git a/tests/clitest.py b/tests/clitest.py index ac15ea748..05fb07153 100644 --- a/tests/clitest.py +++ b/tests/clitest.py @@ -485,6 +485,7 @@ c.add_compare(""" \ --graphics spice,image_compression=foo,streaming_mode=bar,clipboard_copypaste=yes,mouse_mode=client,filetransfer_enable=on \ --graphics spice,gl=yes,listen=socket \ --graphics spice,gl=yes,listen=none \ +--graphics spice,gl=yes,listen=none,rendernode=/dev/dri/foo \ \ --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 0c084587a..72cc136e9 100644 --- a/tests/xmlparse-xml/change-graphics-out.xml +++ b/tests/xmlparse-xml/change-graphics-out.xml @@ -39,7 +39,7 @@ - + diff --git a/tests/xmlparse.py b/tests/xmlparse.py index 9697fbf88..5c8ab0be6 100644 --- a/tests/xmlparse.py +++ b/tests/xmlparse.py @@ -651,6 +651,7 @@ class XMLParseTest(unittest.TestCase): check("mouse_mode", None, "client") check("filetransfer_enable", None, False) check("gl", None, True) + check("rendernode", None, "/dev/dri/foo") self._alter_compare(guest.get_xml_config(), outfile) diff --git a/virtinst/cli.py b/virtinst/cli.py index 94ba5cbb0..423d8723d 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -2183,6 +2183,12 @@ class ParserGraphics(VirtCLIParser): elif not inst.conn.check_support( inst.conn.SUPPORT_CONN_SPICE_GL): logging.warn("qemu/libvirt version may not support spice GL") + if inst.conn.is_qemu() and inst.rendernode: + if inst.type != "spice": + logging.warn("graphics type=%s does not support rendernode", inst.type) + elif not inst.conn.check_support( + inst.conn.SUPPORT_CONN_SPICE_RENDERNODE): + logging.warn("qemu/libvirt version may not support rendernode") return ret @@ -2206,6 +2212,7 @@ ParserGraphics.add_arg("mouse_mode", "mouse_mode") ParserGraphics.add_arg("filetransfer_enable", "filetransfer_enable", is_onoff=True) ParserGraphics.add_arg("gl", "gl", is_onoff=True) +ParserGraphics.add_arg("rendernode", "rendernode") ######################## diff --git a/virtinst/devicegraphics.py b/virtinst/devicegraphics.py index 634b6df06..578c2f59a 100644 --- a/virtinst/devicegraphics.py +++ b/virtinst/devicegraphics.py @@ -244,5 +244,6 @@ class VirtualGraphics(VirtualDevice): mouse_mode = XMLProperty("./mouse/@mode") filetransfer_enable = XMLProperty("./filetransfer/@enable", is_yesno=True) gl = XMLProperty("./gl/@enable", is_yesno=True) + rendernode = XMLProperty("./gl/@rendernode") VirtualGraphics.register_type() diff --git a/virtinst/support.py b/virtinst/support.py index ebbc0a989..a86df6893 100644 --- a/virtinst/support.py +++ b/virtinst/support.py @@ -315,6 +315,8 @@ SUPPORT_CONN_MEM_STATS_PERIOD = _make( # first version that sorts out the qemu:///system + cgroup issues SUPPORT_CONN_SPICE_GL = _make(version="3.1.0", hv_version={"qemu": "2.6.0", "test": 0}) +SUPPORT_CONN_SPICE_RENDERNODE = _make(version="3.1.0", + hv_version={"qemu": "2.9.0", "test": 0}) SUPPORT_CONN_VIDEO_VIRTIO_ACCEL3D = _make(version="1.3.0", hv_version={"qemu": "2.5.0", "test": 0}) SUPPORT_CONN_GRAPHICS_LISTEN_NONE = _make(version="2.0.0")