]> git.proxmox.com Git - qemu-server.git/commitdiff
api: add clipboard variable to return at status/current
authorMarkus Frank <m.frank@proxmox.com>
Tue, 14 Nov 2023 09:22:52 +0000 (10:22 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 20 Nov 2023 15:20:26 +0000 (16:20 +0100)
This can be used by noVNC to check if a clipboard is available.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/API2/Qemu.pm

index 01774899ce04e2ac141d626c6a2bafccbe45b1ea..2bca07fa1011332f710496cbb55e02577be2e361 100644 (file)
@@ -2699,6 +2699,13 @@ __PACKAGE__->register_method({
                type => 'boolean',
                optional => 1,
            },
+           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,
+           },
        },
     },
     code => sub {
@@ -2717,6 +2724,7 @@ __PACKAGE__->register_method({
            my $spice = defined($vga->{type}) && $vga->{type} =~ /^virtio/;
            $spice ||= PVE::QemuServer::vga_conf_has_spice($conf->{vga});
            $status->{spice} = 1 if $spice;
+           $status->{clipboard} = $vga->{clipboard};
        }
        $status->{agent} = 1 if PVE::QemuServer::get_qga_key($conf, 'enabled');