[libvirt PATCH 0/3] Enable copy/paste for vnc displays

Jonathon Jongsma posted 3 patches 2 years, 1 month ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20220322204706.1739412-1-jjongsma@redhat.com
There is a newer version of this series
docs/formatdomain.rst                         | 17 ++++++
src/conf/domain_conf.c                        | 49 ++++++++++++++++-
src/conf/domain_conf.h                        |  7 +++
src/conf/domain_validate.c                    |  1 +
src/conf/schemas/domaincommon.rng             | 11 ++++
src/qemu/qemu_capabilities.c                  |  2 +
src/qemu/qemu_capabilities.h                  |  1 +
src/qemu/qemu_command.c                       | 13 +++++
src/qemu/qemu_monitor_json.c                  | 10 ++++
src/qemu/qemu_process.c                       |  1 +
src/qemu/qemu_validate.c                      |  1 +
src/security/security_dac.c                   |  2 +
.../caps_6.1.0.x86_64.xml                     |  1 +
.../caps_6.2.0.aarch64.xml                    |  1 +
.../caps_6.2.0.x86_64.xml                     |  1 +
.../caps_7.0.0.x86_64.xml                     |  1 +
.../channel-qemu-vdagent.x86_64-latest.args   | 41 ++++++++++++++
.../qemuxml2argvdata/channel-qemu-vdagent.xml | 34 ++++++++++++
tests/qemuxml2argvtest.c                      |  1 +
.../channel-qemu-vdagent.x86_64-latest.xml    | 55 +++++++++++++++++++
tests/qemuxml2xmltest.c                       |  1 +
tests/testutilsqemu.c                         |  1 +
22 files changed, 250 insertions(+), 2 deletions(-)
create mode 100644 tests/qemuxml2argvdata/channel-qemu-vdagent.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/channel-qemu-vdagent.xml
create mode 100644 tests/qemuxml2xmloutdata/channel-qemu-vdagent.x86_64-latest.xml
[libvirt PATCH 0/3] Enable copy/paste for vnc displays
Posted by Jonathon Jongsma 2 years, 1 month ago
This patch series enables support for the qemu-vdagent character device which
enables copy/paste support between guest and client when using vnc graphics.

The guest must be configured with something like the following:

    <channel type='qemu-vdagent'>
      <source clipboard='on' mouse='on'/>
      <target type='virtio' name='com.redhat.spice.0'/>
    </channel>

Copy/paste sync requires a vnc client that has support for copy/paste commands.
Currently virt-viewer does not work, but the version of tigervnc provided by
fedora (executable name 'vncviewer') does work.

More details about this device on Gerd's blog:
https://www.kraxel.org/blog/2021/05/qemu-cut-paste/

OPEN QUESTIONS:

- I'm not fully convinced that the `<source>` element is the right place for
  the new `clipboard` / `mouse` configuration options, but I'm not sure that
  adding a new xml element to the `<channel>` is the right approach either.
  Suggestions welcome.
- There may be an expectation that vnc clipboard is enabled using the
  <graphics type='vnc'><clipboard copypaste='yes'/></graphics> similar to what
  spice offers. In fact, it seems that this is the approach Marc-Andre took
  when adding copy/paste support in his dbus display patch series. But even for
  spice, this <clipboard> configuration element is not enough to enable the
  copy/paste feature. It also requires a 'spicevmc' character device to be
  added to the domain.

Jonathon Jongsma (3):
  qemu: add capability for qemu-vdagent chardev
  conf: add qemu-vdagent channel
  qemu: add support for qemu-vdagent channel

 docs/formatdomain.rst                         | 17 ++++++
 src/conf/domain_conf.c                        | 49 ++++++++++++++++-
 src/conf/domain_conf.h                        |  7 +++
 src/conf/domain_validate.c                    |  1 +
 src/conf/schemas/domaincommon.rng             | 11 ++++
 src/qemu/qemu_capabilities.c                  |  2 +
 src/qemu/qemu_capabilities.h                  |  1 +
 src/qemu/qemu_command.c                       | 13 +++++
 src/qemu/qemu_monitor_json.c                  | 10 ++++
 src/qemu/qemu_process.c                       |  1 +
 src/qemu/qemu_validate.c                      |  1 +
 src/security/security_dac.c                   |  2 +
 .../caps_6.1.0.x86_64.xml                     |  1 +
 .../caps_6.2.0.aarch64.xml                    |  1 +
 .../caps_6.2.0.x86_64.xml                     |  1 +
 .../caps_7.0.0.x86_64.xml                     |  1 +
 .../channel-qemu-vdagent.x86_64-latest.args   | 41 ++++++++++++++
 .../qemuxml2argvdata/channel-qemu-vdagent.xml | 34 ++++++++++++
 tests/qemuxml2argvtest.c                      |  1 +
 .../channel-qemu-vdagent.x86_64-latest.xml    | 55 +++++++++++++++++++
 tests/qemuxml2xmltest.c                       |  1 +
 tests/testutilsqemu.c                         |  1 +
 22 files changed, 250 insertions(+), 2 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/channel-qemu-vdagent.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/channel-qemu-vdagent.xml
 create mode 100644 tests/qemuxml2xmloutdata/channel-qemu-vdagent.x86_64-latest.xml

-- 
2.35.1

Re: [libvirt PATCH 0/3] Enable copy/paste for vnc displays
Posted by Daniel P. Berrangé 2 years, 1 month ago
On Tue, Mar 22, 2022 at 03:47:03PM -0500, Jonathon Jongsma wrote:
> This patch series enables support for the qemu-vdagent character device which
> enables copy/paste support between guest and client when using vnc graphics.
> 
> The guest must be configured with something like the following:
> 
>     <channel type='qemu-vdagent'>
>       <source clipboard='on' mouse='on'/>

I'd suggest we represent these the same way as spice for consistency
ie elements rather than attributes

     <channel type='qemu-vdagent'>
       <source>
          <clipboard copypaste='no'/>
          <mouse mode='client'/>
       </source>
       <target type='virtio' name='com.redhat.spice.0'/>
     </channel>


compare with how the vdagent pieces in <graphics> appear:

  <graphics type='spice' port='-1' tlsPort='-1' autoport='yes'>
    <channel name='main' mode='secure'/>
    <channel name='record' mode='insecure'/>
    <image compression='auto_glz'/>
    <streaming mode='filter'/>
    <clipboard copypaste='no'/>
    <mouse mode='client'/>
    <filetransfer enable='no'/>
    <gl enable='yes' rendernode='/dev/dri/by-path/pci-0000:00:02.0-render'/>
  </graphics>

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
Re: [libvirt PATCH 0/3] Enable copy/paste for vnc displays
Posted by Marc-André Lureau 2 years, 1 month ago
Hi

On Wed, Mar 23, 2022 at 12:47 AM Jonathon Jongsma <jjongsma@redhat.com> wrote:
>
> This patch series enables support for the qemu-vdagent character device which
> enables copy/paste support between guest and client when using vnc graphics.
>
> The guest must be configured with something like the following:
>
>     <channel type='qemu-vdagent'>
>       <source clipboard='on' mouse='on'/>
>       <target type='virtio' name='com.redhat.spice.0'/>
>     </channel>
>
> Copy/paste sync requires a vnc client that has support for copy/paste commands.
> Currently virt-viewer does not work, but the version of tigervnc provided by
> fedora (executable name 'vncviewer') does work.
>
> More details about this device on Gerd's blog:
> https://www.kraxel.org/blog/2021/05/qemu-cut-paste/
>
> OPEN QUESTIONS:
>
> - I'm not fully convinced that the `<source>` element is the right place for
>   the new `clipboard` / `mouse` configuration options, but I'm not sure that
>   adding a new xml element to the `<channel>` is the right approach either.
>   Suggestions welcome.

I am not convinced <channel> is appropriate either for -chardev
qemu-vdagent. That's why in my dbus display series it's an
implementation detail
(https://patchew.org/Libvirt/20211222194345.766352-1-marcandre.lureau@redhat.com/20211222194345.766352-13-marcandre.lureau@redhat.com/),
and it's not exposed to the domain XML directly. However I realize
that my approach is probably broken, as it looks like I totally missed
the associated virtserialport! :)

As you say "source" is strange to put those extra channel options too.

And the only really valid associated device is a virtserialport of
name "com.redhat.spice.0", so what's the point in exposing that detail
to the user?

> - There may be an expectation that vnc clipboard is enabled using the
>   <graphics type='vnc'><clipboard copypaste='yes'/></graphics> similar to what
>   spice offers. In fact, it seems that this is the approach Marc-Andre took
>   when adding copy/paste support in his dbus display patch series. But even for
>   spice, this <clipboard> configuration element is not enough to enable the
>   copy/paste feature. It also requires a 'spicevmc' character device to be
>   added to the domain.

And my dbus solution is not complete, although it should be possible
to add the missing virtserialport.

>
> Jonathon Jongsma (3):
>   qemu: add capability for qemu-vdagent chardev
>   conf: add qemu-vdagent channel
>   qemu: add support for qemu-vdagent channel
>
>  docs/formatdomain.rst                         | 17 ++++++
>  src/conf/domain_conf.c                        | 49 ++++++++++++++++-
>  src/conf/domain_conf.h                        |  7 +++
>  src/conf/domain_validate.c                    |  1 +
>  src/conf/schemas/domaincommon.rng             | 11 ++++
>  src/qemu/qemu_capabilities.c                  |  2 +
>  src/qemu/qemu_capabilities.h                  |  1 +
>  src/qemu/qemu_command.c                       | 13 +++++
>  src/qemu/qemu_monitor_json.c                  | 10 ++++
>  src/qemu/qemu_process.c                       |  1 +
>  src/qemu/qemu_validate.c                      |  1 +
>  src/security/security_dac.c                   |  2 +
>  .../caps_6.1.0.x86_64.xml                     |  1 +
>  .../caps_6.2.0.aarch64.xml                    |  1 +
>  .../caps_6.2.0.x86_64.xml                     |  1 +
>  .../caps_7.0.0.x86_64.xml                     |  1 +
>  .../channel-qemu-vdagent.x86_64-latest.args   | 41 ++++++++++++++
>  .../qemuxml2argvdata/channel-qemu-vdagent.xml | 34 ++++++++++++
>  tests/qemuxml2argvtest.c                      |  1 +
>  .../channel-qemu-vdagent.x86_64-latest.xml    | 55 +++++++++++++++++++
>  tests/qemuxml2xmltest.c                       |  1 +
>  tests/testutilsqemu.c                         |  1 +
>  22 files changed, 250 insertions(+), 2 deletions(-)
>  create mode 100644 tests/qemuxml2argvdata/channel-qemu-vdagent.x86_64-latest.args
>  create mode 100644 tests/qemuxml2argvdata/channel-qemu-vdagent.xml
>  create mode 100644 tests/qemuxml2xmloutdata/channel-qemu-vdagent.x86_64-latest.xml
>
> --
> 2.35.1
>
>