Francesco Romani has uploaded a new change for review.

Change subject: spice: support to agent file transfer disable
......................................................................

spice: support to agent file transfer disable

Spice has agent based file transfer support.
This option can be disabled in QEMU, and  libvirt has support
to pass this flag to the underlying QEMU.

This patch expose this capability in VDSM, in the VM definition,
implementing the VDSM part of bz983019.
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: Icc98a346baca4ab163ff30e891ae80535e49caa4
Bug-Url: https://bugzilla.redhat.com/983019
Signed-off-by: Francesco Romani <from...@redhat.com>
---
M debian/control
M tests/vmTests.py
M vdsm.spec.in
M vdsm/virt/vm.py
M vdsm_api/vdsmapi-schema.json
5 files changed, 40 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/17/26917/1

diff --git a/debian/control b/debian/control
index 45c2b1c..ddbaab3 100644
--- a/debian/control
+++ b/debian/control
@@ -20,7 +20,7 @@
  python-cpopen (>= 1.3),
  python-dmidecode,
  python-ethtool (>=0.8),
- python-libvirt (>= 1.0.2),
+ python-libvirt (>= 1.2.2),
  python-m2crypto,
  python-netaddr,
  python-nose,
@@ -81,8 +81,8 @@
  libnl1,
  libsanlock-client1 (>= 2.4),
  libsanlock-dev (>= 2.4),
- libvirt-bin (>= 1.0.2),
- libvirt0 (>= 1.0.2),
+ libvirt-bin (>= 1.2.2),
+ libvirt0 (>= 1.2.2),
  linux-image-generic (>= 3.6),
  logrotate,
  lvm2 (>= 2.02.95),
@@ -98,7 +98,7 @@
  python-dmidecode,
  python-ethtool (>= 0.8),
  python-ethtool (>= 0.8),
- python-libvirt (>= 1.0.2),
+ python-libvirt (>= 1.2.2),
  python-m2crypto,
  python-netaddr,
  python-parted,
@@ -294,7 +294,7 @@
 
 Package: vdsm-hook-sriov
 Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, python (>=2.7.3), vdsm (>= 
${source:Version}), libvirt-bin (>= 1.0.2-1)
+Depends: ${shlibs:Depends}, ${misc:Depends}, python (>=2.7.3), vdsm (>= 
${source:Version}), libvirt-bin (>= 1.2.2-1)
 Description: sr-iov support for VDSM
  sr-iov hook enable to add virtual functions exposed by the device
  directly to a virtual machine.
diff --git a/tests/vmTests.py b/tests/vmTests.py
index 91ee466..11695b3 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -421,6 +421,20 @@
                       passwdValidTo="1970-01-01T00:00:01" port="-1"
                       tlsPort="-1" type="spice">
                 <channel mode="secure" name="main"/>
+            </graphics>""",
+
+            """
+            <graphics autoport="yes" listen="0" passwd="*****"
+                    passwdValidTo="1970-01-01T00:00:01" port="-1"
+                    tlsPort="-1" type="spice">
+                <filetransfer enable="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>"""]
 
         vmConfs = [
@@ -432,6 +446,16 @@
             {'type': 'graphics', 'device': 'spice',
              'specParams': {
                   'port': '-1', 'tlsPort': '-1',
+                 'spiceSecureChannels': 'smain'}},
+
+           {'type': 'graphics', 'device': 'spice',
+             'specParams': {
+                  'port': '-1', 'tlsPort': '-1',
+                 'fileTransferEnable': 'false'}},
+
+            {'type': 'graphics', 'device': 'spice',
+             'specParams': {
+                  'port': '-1', 'tlsPort': '-1',
                  'spiceSecureChannels': 'smain'}}]
 
         self._verifyGraphicsXML(expectedXMLs, vmConfs, False)
diff --git a/vdsm.spec.in b/vdsm.spec.in
index fd47bf6..af339e2 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -131,7 +131,7 @@
 %endif
 
 %if 0%{?rhel} >= 7 || 0%{?fedora} >= 18
-Requires: libvirt-daemon >= 1.0.2-1
+Requires: libvirt-daemon >= 1.2.2-1
 Requires: libvirt-daemon-config-nwfilter
 Requires: libvirt-daemon-driver-network
 Requires: libvirt-daemon-driver-nwfilter
@@ -140,7 +140,7 @@
 %if 0%{?rhel}
 Requires: libvirt >= 0.10.2-29.el6_5.4
 %else
-Requires: libvirt >= 1.0.2-1
+Requires: libvirt >= 1.2.2-1
 %endif
 %endif
 Requires: libvirt-python, libvirt-lock-sanlock, libvirt-client
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index d68c292..27c2aab 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1415,6 +1415,10 @@
             clipboard = XMLElement('clipboard', copypaste='no')
             graphics.appendChild(clipboard)
 
+        if not utils.tobool(self.specParams.get('fileTransferEnable', True)):
+            filetransfer = XMLElement('filetransfer', enable='no')
+            graphics.appendChild(filetransfer)
+
         #  handle deprecated channel name in a smart way,
         #  not just chop 1st char!
         if graphicsAttrs['type'] == 'spice':
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 0300a27..0a8c506 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -2523,12 +2523,16 @@
 # @copyPasteEnable:       #optional Specify if copy and paste is enabled.
 #                         Currently relevant for @spice devices only.
 #
+# @fileTransferEnable:    #optional Specify if file transfer is enabled.
+#                         Currently relevant for @qxl devices only.
+#
 # Since: 4.15.0
 ##
 {'type': 'VmGraphicsDeviceSpecParams',
  'data': {'port': 'uint', '*tlsPort': 'uint', '*keyMap': 'str',
           '*disableTicketing': 'bool', '*displayNetwork': 'str',
-          '*spiceSecureChannels': 'str', '*copyPasteEnable': 'bool'}}
+          '*spiceSecureChannels': 'str', '*copyPasteEnable': 'bool',
+          '*fileTransferEnable': 'bool'}}
 
 ##
 # @VmGraphicsDevice:


-- 
To view, visit http://gerrit.ovirt.org/26917
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc98a346baca4ab163ff30e891ae80535e49caa4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <from...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to