Francesco Romani has uploaded a new change for review.
Change subject: vm: spice support to clipboard copypaste disable ......................................................................
vm: spice support to clipboard copypaste disable
since version 0.9.3, libvirt allows to optionally disable copy and paste in the spice protocolol:
http://libvirt.org/formatdomain.html#elementsGraphics
this patch expose this capability in VDSM, in the VM definition. The new parameter is optional and enabled by default for backward compatibility.
No XML changes are produced at all unless the new parameter is specified.
Change-Id: I1f8195da0c3ba2663027b77ea8a858e5ba17c48e Signed-off-by: Francesco Romani fromani@redhat.com --- M tests/vmTests.py M vdsm/vm.py M vdsm_api/vdsmapi-schema.json 3 files changed, 38 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/46/22646/1
diff --git a/tests/vmTests.py b/tests/vmTests.py index f9f2785..be1c6c1 100644 --- a/tests/vmTests.py +++ b/tests/vmTests.py @@ -229,6 +229,20 @@ <channel mode="secure" name="playback"/> <channel mode="secure" name="record"/> <channel mode="secure" name="display"/> + </graphics>""", + + """ + <graphics autoport="yes" listen="0" passwd="*****" + passwdValidTo="1970-01-01T00:00:01" port="-1" + tlsPort="-1" type="spice"> + <clipboard copypaste="no"/> + </graphics>""", + + """ + <graphics autoport="yes" listen="0" passwd="*****" + passwdValidTo="1970-01-01T00:00:01" port="-1" + tlsPort="-1" type="spice"> + <channel mode="secure" name="main"/> </graphics>"""]
spiceChannelXML = """ @@ -242,7 +256,13 @@
{'display': 'qxl', 'displayPort': '-1', 'displaySecurePort': '-1', 'spiceSecureChannels': - "smain,sinputs,scursor,splayback,srecord,sdisplay"}] + "smain,sinputs,scursor,splayback,srecord,sdisplay"}, + + {'display': 'qxl', 'displayPort': '-1', 'displaySecurePort': '-1', + 'copyPasteEnable': 'false'}, + + {'display': 'qxl', 'displayPort': '-1', 'displaySecurePort': '-1', + 'copyPasteEnable': 'true', 'spiceSecureChannels': "smain"}]
for vmConf, xml in zip(vmConfs, expectedXMLs): vmConf.update(self.conf) diff --git a/vdsm/vm.py b/vdsm/vm.py index 0a602cb..306ceb3 100644 --- a/vdsm/vm.py +++ b/vdsm/vm.py @@ -1108,6 +1108,12 @@ <channel type='spicevmc'> <target type='virtio' name='com.redhat.spice.0'/> </channel> + + or + + <graphics autoport="yes" port="5910" tlsPort="5890" type="spice"> + <clipboard copypaste='no'/> + </graphics> """ graphicsAttrs = {'port': self.conf['displayPort'], 'autoport': 'yes'} if self.conf['display'] == 'vnc': @@ -1129,6 +1135,9 @@ for channel in self.conf['spiceSecureChannels'].split(','): graphics.appendChildWithArgs('channel', name=channel[1:], mode='secure') + if not utils.tobool(self.conf.get('copyPasteEnable', True)): + clipboard = XMLElement('clipboard', copypaste='no') + graphics.appendChild(clipboard)
vmc = XMLElement('channel', type='spicevmc') vmc.appendChildWithArgs('target', type='virtio', diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json index ce9204f..f813e77 100644 --- a/vdsm_api/vdsmapi-schema.json +++ b/vdsm_api/vdsmapi-schema.json @@ -2781,6 +2781,10 @@ # # @clientIp: The IP address of the client connected to the display # +# @copyPasteEnable: #optional Specify if copy and paste is enabled. +# Currently relevant for @qxl devices only. +# (new in version 4.13.0) +# # @cpuShares: #optional The host scheduling priority (relative to # other VMs). In case both cpuShares and nice are # present, cpuShares will be used. @@ -2847,10 +2851,10 @@ # Since: 4.10.0 ## {'type': 'VmDefinition', - 'data': {'acpiEnable': 'bool', 'clientIp': 'str', 'cpuShares': 'str', - '*cpuType': 'str', '*custom': 'StringMap', '*devices': ['VmDevice'], - 'display': 'VmDisplayType', 'displayIp': 'str', - 'displayPort': 'int', 'displaySecurePort': 'int', + 'data': {'acpiEnable': 'bool', 'clientIp': 'str', '*copyPasteEnable': 'bool', + 'cpuShares': 'str', '*cpuType': 'str', '*custom': 'StringMap', + '*devices': ['VmDevice'], 'display': 'VmDisplayType', + 'displayIp': 'str', 'displayPort': 'int', 'displaySecurePort': 'int', '*emulatedMachine': 'str', '*keyboardLayout': 'str', 'kvmEnable': 'bool', 'memSize': 'uint', 'memGuaranteedSize': 'uint', 'nicModel': 'str', 'nice': 'int', '*pauseCode': 'str',
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vm: spice support to clipboard copypaste disable ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/6235/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/5448/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/6341/ : SUCCESS
Francesco Romani has posted comments on this change.
Change subject: vm: spice support to clipboard copypaste disable ......................................................................
Patch Set 1: Verified+1
no regressions in VM definitions
Francesco Romani has posted comments on this change.
Change subject: vm: spice support to clipboard copypaste disable ......................................................................
Patch Set 1: -Verified
test with new parameter enabled pending due to lack of UI :)
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vm: spice support to clipboard copypaste disable ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/6754/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/6667/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/5862/ : SUCCESS
Yaniv Bronhaim has posted comments on this change.
Change subject: vm: spice support to clipboard copypaste disable ......................................................................
Patch Set 2:
(1 comment)
http://gerrit.ovirt.org/#/c/22646/2/vdsm_api/vdsmapi-schema.json File vdsm_api/vdsmapi-schema.json:
Line 2782: # @clientIp: The IP address of the client connected to the display Line 2783: # Line 2784: # @copyPasteEnable: #optional Specify if copy and paste is enabled. Line 2785: # Currently relevant for @qxl devices only. Line 2786: # (new in version 4.13.0) new in 4.15.0 .. it's still not merged and we aim it to 3.5 Line 2787: # Line 2788: # @cpuShares: #optional The host scheduling priority (relative to Line 2789: # other VMs). In case both cpuShares and nice are Line 2790: # present, cpuShares will be used.
Francesco Romani has posted comments on this change.
Change subject: vm: spice support to clipboard copypaste disable ......................................................................
Patch Set 2:
(1 comment)
http://gerrit.ovirt.org/#/c/22646/2/vdsm_api/vdsmapi-schema.json File vdsm_api/vdsmapi-schema.json:
Line 2782: # @clientIp: The IP address of the client connected to the display Line 2783: # Line 2784: # @copyPasteEnable: #optional Specify if copy and paste is enabled. Line 2785: # Currently relevant for @qxl devices only. Line 2786: # (new in version 4.13.0)
new in 4.15.0 .. it's still not merged and we aim it to 3.5
Done Line 2787: # Line 2788: # @cpuShares: #optional The host scheduling priority (relative to Line 2789: # other VMs). In case both cpuShares and nice are Line 2790: # present, cpuShares will be used.
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vm: spice support to clipboard copypaste disable ......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/5965/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/6753/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/6859/ : SUCCESS
Federico Simoncelli has posted comments on this change.
Change subject: vm: spice support to clipboard copypaste disable ......................................................................
Patch Set 3: Code-Review+1
(1 comment)
http://gerrit.ovirt.org/#/c/22646/3/vdsm/vm.py File vdsm/vm.py:
Line 1134: if self.conf.get('spiceSecureChannels'): Line 1135: for channel in self.conf['spiceSecureChannels'].split(','): Line 1136: graphics.appendChildWithArgs('channel', name=channel[1:], Line 1137: mode='secure') Line 1138: if not utils.tobool(self.conf.get('copyPasteEnable', True)): After __slots__ being merged I was expecting to see this appearing there too. Is it because the patch is not rebased or is it because we don't have __slots__ for these special devices? Line 1139: clipboard = XMLElement('clipboard', copypaste='no') Line 1140: graphics.appendChild(clipboard) Line 1141: Line 1142: vmc = XMLElement('channel', type='spicevmc')
Francesco Romani has posted comments on this change.
Change subject: vm: spice support to clipboard copypaste disable ......................................................................
Patch Set 3:
(1 comment)
http://gerrit.ovirt.org/#/c/22646/3/vdsm/vm.py File vdsm/vm.py:
Line 1134: if self.conf.get('spiceSecureChannels'): Line 1135: for channel in self.conf['spiceSecureChannels'].split(','): Line 1136: graphics.appendChildWithArgs('channel', name=channel[1:], Line 1137: mode='secure') Line 1138: if not utils.tobool(self.conf.get('copyPasteEnable', True)):
After __slots__ being merged I was expecting to see this appearing there to
Well the patch was not rebased yet. Will address after rebase. Line 1139: clipboard = XMLElement('clipboard', copypaste='no') Line 1140: graphics.appendChild(clipboard) Line 1141: Line 1142: vmc = XMLElement('channel', type='spicevmc')
Francesco Romani has posted comments on this change.
Change subject: vm: spice support to clipboard copypaste disable ......................................................................
Patch Set 3: Code-Review-1
We probably want to move this option into specParams to be more forward compatible with the graphics device patcheset (http://gerrit.ovirt.org/#/c/23555/). self-inflicred -1 until this is sorted out.
Francesco Romani has posted comments on this change.
Change subject: vm: spice support to clipboard copypaste disable ......................................................................
Patch Set 3: -Code-Review
independent patch to have this feature on top of the GraphicsDevice patchset here: http://gerrit.ovirt.org/#/c/26916/
Francesco Romani has posted comments on this change.
Change subject: vm: spice support to clipboard copypaste disable ......................................................................
Patch Set 4:
patch set 4: rebased
oVirt Jenkins CI Server has posted comments on this change.
Change subject: vm: spice support to clipboard copypaste disable ......................................................................
Patch Set 4:
Build Failed
http://jenkins.ovirt.org/job/vdsm_master_pep8_gerrit/8187/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit/8300/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_master_unit_tests_gerrit_el/7397/ : SUCCESS
Dan Kenigsberg has posted comments on this change.
Change subject: vm: spice support to clipboard copypaste disable ......................................................................
Patch Set 4: Code-Review-1
(2 comments)
http://gerrit.ovirt.org/#/c/22646/4//COMMIT_MSG Commit Message:
Line 17: Line 18: No XML changes are produced at all unless the new parameter is Line 19: specified. Line 20: Line 21: Bug-Url: https://bugzilla.redhat.com/800155 please make this bug public, and/or link to to https://bugzilla.redhat.com/show_bug.cgi?id=1052959 instead. Line 22: Change-Id: I1f8195da0c3ba2663027b77ea8a858e5ba17c48e
http://gerrit.ovirt.org/#/c/22646/4/vdsm/virt/vm.py File vdsm/virt/vm.py:
Line 806: <channel type='spicevmc'> Line 807: <target type='virtio' name='com.redhat.spice.0'/> Line 808: </channel> Line 809: Line 810: or these two are not contradictory. the <clipboard> element is simply optional - it's not on the same level of vnc/spice distinction. Line 811: Line 812: <graphics autoport="yes" port="5910" tlsPort="5890" type="spice"> Line 813: <clipboard copypaste='no'/> Line 814: </graphics>
Francesco Romani has posted comments on this change.
Change subject: vm: spice support to clipboard copypaste disable ......................................................................
Patch Set 4: Code-Review-1 Verified-1
We decide to push this on top of the GraphicsDevice. See: http://gerrit.ovirt.org/#/c/26917
Francesco Romani has abandoned this change.
Change subject: vm: spice support to clipboard copypaste disable ......................................................................
Abandoned
implemented in a different way.
vdsm-patches@lists.fedorahosted.org