virtinst/cli: add spice rendernode argument

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2017-02-21 17:01:00 +04:00 committed by Cole Robinson
parent 4c82ff59e8
commit dffb2aaa2d
8 changed files with 22 additions and 1 deletions

View File

@ -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<rendernode>
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<http://libvirt.org/formatdomain.html#elementsGraphics>

View File

@ -246,6 +246,11 @@
<image compression="off"/>
<listen type="none"/>
</graphics>
<graphics type="spice">
<gl enable="yes" rendernode="/dev/dri/foo"/>
<image compression="off"/>
<listen type="none"/>
</graphics>
<serial type="tcp">
<source mode="bind" host="127.0.0.1" service="2222"/>
<protocol type="telnet"/>

View File

@ -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 \

View File

@ -39,7 +39,7 @@
<channel name="cursor" mode="any"/>
<channel name="playback" mode="insecure"/>
<channel name="display" mode="secure"/>
<gl enable="yes"/>
<gl enable="yes" rendernode="/dev/dri/foo"/>
<image compression="auto_glz"/>
<streaming mode="filter"/>
<clipboard copypaste="yes"/>

View File

@ -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)

View File

@ -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")
########################

View File

@ -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()

View File

@ -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")