Francesco Romani has uploaded a new change for review.

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

vm: 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: I8cde372e6bf2f46b2ceac4e8660b5b05f02aaccb
Signed-off-by: Francesco Romani <from...@redhat.com>
---
M tests/vmTests.py
M vdsm/vm.py
M vdsm_api/vdsmapi-schema.json
3 files changed, 40 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/70/23270/1

diff --git a/tests/vmTests.py b/tests/vmTests.py
index 6215041..2594dc2 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -304,6 +304,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">
+                <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>"""]
 
         spiceChannelXML = """
@@ -317,7 +331,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',
+             'fileTransferEnable': 'false'},
+
+            {'display': 'qxl', 'displayPort': '-1', 'displaySecurePort': '-1',
+             'fileTransferEnable': '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 bd5f6d5..ed11d82 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -1186,6 +1186,12 @@
         <channel type='spicevmc'>
            <target type='virtio' name='com.redhat.spice.0'/>
         </channel>
+
+        or
+
+        <graphics autoport="yes" port="5910" tlsPort="5890" type="spice">
+            <filetransfer enable='no'/>
+        </graphics>
         """
         graphicsAttrs = {'port': self.conf['displayPort'], 'autoport': 'yes'}
         if self.conf['display'] == 'vnc':
@@ -1208,6 +1214,10 @@
                     graphics.appendChildWithArgs('channel', name=channel[1:],
                                                  mode='secure')
 
+            if not utils.tobool(self.conf.get('fileTransferEnable', True)):
+                filetransfer = XMLElement('filetransfer', enable='no')
+                graphics.appendChild(filetransfer)
+
             vmc = XMLElement('channel', type='spicevmc')
             vmc.appendChildWithArgs('target', type='virtio',
                                     name='com.redhat.spice.0')
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 564180a..3b258b2 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -2804,6 +2804,10 @@
 #
 # @emulatedMachine:       #optional The machine specification being emulated
 #
+# @fileTransferEnable:    #optional Specify if file transfer is enabled.
+#                         Currently relevant for @qxl devices only.
+#                         (new in version 4.14.0)
+#
 # @keyboardLayout:        #optional The keyboard layout string (eg. 'en-us')
 #
 # @kvmEnable:             Indicates if KVM hardware acceleration is enabled
@@ -2854,10 +2858,11 @@
           '*cpuType': 'str', '*custom': 'StringMap', '*devices': ['VmDevice'],
           'display': 'VmDisplayType', 'displayIp': 'str',
           'displayPort': 'int', 'displaySecurePort': 'int',
-          '*emulatedMachine': 'str', '*keyboardLayout': 'str',
-          'kvmEnable': 'bool', '*maxVCpus': 'uint', 'memSize': 'uint',
-          'memGuaranteedSize': 'uint', 'nicModel': 'str', 'nice': 'int',
-          '*pauseCode': 'str', 'pid': 'uint', 'smp': 'uint', 
'*smpCoresPerSocket': 'uint',
+          '*emulatedMachine': 'str', '*fileTransferEnable': 'bool',
+          '*keyboardLayout': 'str', 'kvmEnable': 'bool',
+          '*maxVCpus': 'uint', 'memSize': 'uint', 'memGuaranteedSize': 'uint',
+          'nicModel': 'str', 'nice': 'int', '*pauseCode': 'str', 'pid': 'uint',
+          'smp': 'uint', '*smpCoresPerSocket': 'uint',
           '*smpThreadsPerCore': 'uint', 'status': 'VmStatus',
           'timeOffset': 'uint', 'transparentHugePages': 'bool',
           'vmId': 'UUID', 'vmName': 'str', 'vmType': 'VmType',


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8cde372e6bf2f46b2ceac4e8660b5b05f02aaccb
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