Re: [PATCH 2/2] spice: expose the QEMU disable file transfer option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, Jan 10, 2014 at 06:21:50PM +0100, Francesco Romani wrote:
> spice-server offers an API to disable file transfer messages
> on the agent channel between the client and the guest.
> This is supported in qemu through the disable-agent-file-xfer option.
> 
> This patch exposes this option to libvirt.
> Adds a new element 'filetransfer', with one property,
> 'filetransfer', which accepts a boolean setting.
> Default is enabled.
> 
> Depends on the capability exported in the first patch of the series.
> ---
>  docs/formatdomain.html.in                          |  8 +++++
>  docs/schemas/domaincommon.rng                      | 11 ++++++
>  src/conf/domain_conf.c                             | 31 ++++++++++++++++-
>  src/conf/domain_conf.h                             | 10 ++++++
>  src/libvirt_private.syms                           |  2 ++
>  src/qemu/qemu_command.c                            |  9 +++++
>  ...emuxml2argv-graphics-spice-agent-file-xfer.args |  9 +++++
>  ...qemuxml2argv-graphics-spice-agent-file-xfer.xml | 40 ++++++++++++++++++++++
>  .../qemuxml2argv-graphics-spice.args               |  5 +--
>  .../qemuxml2argv-graphics-spice.xml                |  1 +
>  tests/qemuxml2argvtest.c                           |  9 ++++-
>  11 files changed, 131 insertions(+), 4 deletions(-)
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.args
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.xml
> 
> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
> index 68860ef..c11a7d3 100644
> --- a/docs/formatdomain.html.in
> +++ b/docs/formatdomain.html.in
> @@ -4042,6 +4042,7 @@ qemu-kvm -net nic,model=? /dev/null
>      <streaming mode='filter'/>
>      <clipboard copypaste='no'/>
>      <mouse mode='client'/>
> +    <filetransfer enable='no'/>
>    &lt;/graphics&gt;</pre>
>              <p>
>                Spice supports variable compression settings for audio,
> @@ -4081,6 +4082,13 @@ qemu-kvm -net nic,model=? /dev/null
>                <span class="since">since 0.9.11</span>. If no mode is
>                specified, the qemu default will be used (client mode).
>              </p>
> +            <p>
> +              File transfer functionality (via Spice agent) is set using the
> +              <code>filetransfer</code> element.
> +              It is enabled by default, and can be disabled by setting the
> +              <code>enable</code> property to <code>no</code> ,
> +              since <span class="since">since 1.2.2</span>.
> +            </p>
>            </dd>
>            <dt><code>"rdp"</code></dt>
>            <dd>
> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
> index 86a60c9..cd2c499 100644
> --- a/docs/schemas/domaincommon.rng
> +++ b/docs/schemas/domaincommon.rng
> @@ -2468,6 +2468,17 @@
>                  <empty/>
>                </element>
>              </optional>
> +            <optional>
> +              <element name="filetransfer">
> +                <attribute name="enable">
> +                  <choice>
> +                    <value>yes</value>
> +                    <value>no</value>
> +                  </choice>
> +                </attribute>
> +                <empty/>
> +              </element>
> +            </optional>
>            </interleave>
>          </group>
>          <group>
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 416d96e..f372406 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -604,6 +604,12 @@ VIR_ENUM_IMPL(virDomainGraphicsSpiceClipboardCopypaste,
>                "yes",
>                "no");
>  
> +VIR_ENUM_IMPL(virDomainGraphicsSpiceAgentFileTransfer,
> +              VIR_DOMAIN_GRAPHICS_SPICE_AGENT_FILE_TRANSFER_LAST,
> +              "default",
> +              "yes",
> +              "no");
> +
>  VIR_ENUM_IMPL(virDomainHostdevMode, VIR_DOMAIN_HOSTDEV_MODE_LAST,
>                "subsystem",
>                "capabilities")
> @@ -8519,6 +8525,26 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
>                      VIR_FREE(copypaste);
>  
>                      def->data.spice.copypaste = copypasteVal;
> +                } else if (xmlStrEqual(cur->name, BAD_CAST "filetransfer")) {
> +                    char *enable = virXMLPropString(cur, "enable");
> +                    int enableVal;
> +
> +                    if (!enable) {
> +                        virReportError(VIR_ERR_XML_ERROR, "%s",
> +                                       _("spice filetransfer missing enable"));
> +                        goto error;
> +                    }
> +
> +                    if ((enableVal =
> +                         virDomainGraphicsSpiceAgentFileTransferTypeFromString(enable)) <= 0) {
> +                        virReportError(VIR_ERR_XML_ERROR,

It turns out this one should be _CONFIG_UNSUPPORTED, see
https://www.redhat.com/archives/libvir-list/2014-January/msg00521.html . Sorry for giving you a
wrong advice on this before.
ACK from me if you squash this change in before pushing. This will have to
wait after 1.2.1 release though.

Christophe

Attachment: pgpFN8YAmOrvT.pgp
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]