public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Markus Frank <m.frank@proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server v10 1/6] enable VNC clipboard parameter in vga_fmt
Date: Thu, 7 Sep 2023 11:35:21 +0200	[thread overview]
Message-ID: <18e08f5d-575b-4b86-b570-4112da58f771@proxmox.com> (raw)
In-Reply-To: <20230824080354.20165-2-m.frank@proxmox.com>

Am 24/08/2023 um 10:03 schrieb Markus Frank:
> added option to use the qemu vdagent implementation to enable the VNC
> clipboard. When enabled with SPICE the spice-vdagent gets replaced with the QEMU
> implementation.
> 
> This patch does not solve #1406, but does allow copy and paste with
> a running X-session, when spice-vdagent is installed on the guest.
> 
> Signed-off-by: Markus Frank <m.frank@proxmox.com>
> ---
>  PVE/API2/Qemu.pm  |  7 ++++++
>  PVE/QemuServer.pm | 61 +++++++++++++++++++++++++++++++++--------------
>  2 files changed, 50 insertions(+), 18 deletions(-)
> 

> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index bf1de17..9dc6e3c 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -195,8 +195,17 @@ my $vga_fmt = {
>  	minimum => 4,
>  	maximum => 512,
>      },
> +    'vnc-clipboard' => {
> +	description => "enable VNC clipboard (requires SPICE guest tools/"
> +	    ."SPICE vdagent installed on the guest OS).",
> +	type => 'boolean',
> +	optional => 1,
> +	default => 0,


I was about to apply this, but when replying to the UI patch I started to
question the boolean approach, especially w.r.t. that we might want to
decouple the chosen "display" and the added SPÌCE channel & features in
the future, so that one can explicitily add SPICE for any display type,
if wanted.

With that in mind it might be slightly more future proof if we use a
enum for the clipoard value, for now it would probably look something
like:

clipboard => {
    description => 'Enable a specific clipboard. If not set, depending on'
        .' the display type the SPICE one will be added.',
    type => 'string',
    enum => ['vnc'],
    optional => 1,
}

it might make sense to add the non-existing part explicitly already now,
e.g., by some 'auto' value in the enum, but no hard feelings here.


The current status API should then be changed accordingly to return a
"clipboard" key with the respective value, if set.

> +    },
>  };
>  
> +my $vnc_clipboard_regex = qr/^(std|cirrus|vmware|virtio|qxl)/;

I'd declare that inline in the "assert_vnc_clipboard_config" directly  as long
as it's not used by other helpers.


> +
>  my $ivshmem_fmt = {
>      size => {
>  	type => 'integer',
> @@ -1375,6 +1384,14 @@ sub pve_verify_hotplug_features {
>      die "unable to parse hotplug option\n";
>  }
>  
> +sub assert_vnc_clipboard_config {
> +    my ($vga) = @_;
> +
> +    if ($vga->{'vnc-clipboard'} && $vga->{type} && $vga->{type} !~ $vnc_clipboard_regex) {
> +	die "vga type $vga->{type} is not compatible with VNC clipboard\n";
> +    }
> +}
> +






  reply	other threads:[~2023-09-07  9:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-24  8:03 [pve-devel] [PATCH qemu-server v10 0/6] Feature VNC-Clipboard Markus Frank
2023-08-24  8:03 ` [pve-devel] [PATCH qemu-server v10 1/6] enable VNC clipboard parameter in vga_fmt Markus Frank
2023-09-07  9:35   ` Thomas Lamprecht [this message]
2023-08-24  8:03 ` [pve-devel] [PATCH qemu-server v10 3/6] test cases for clipboard spice & std Markus Frank
2023-08-24  8:03 ` [pve-devel] [PATCH novnc v10 4/6] add "show clipboard button" patch to series Markus Frank
2023-08-24  8:03 ` [pve-devel] [PATCH manager v10 5/6] add clipboard checkbox to VM Options Markus Frank
2023-09-07  9:38   ` Thomas Lamprecht
2023-08-24  8:03 ` [pve-devel] [PATCH docs v10 6/6] add noVNC clipboard documentation Markus Frank

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18e08f5d-575b-4b86-b570-4112da58f771@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=m.frank@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal