]> git.proxmox.com Git - pve-manager.git/commitdiff
api: resource usb mapping: add missing proxyto_callback
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 21 Jun 2023 10:05:09 +0000 (12:05 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 21 Jun 2023 10:51:47 +0000 (12:51 +0200)
i have added it to the pci api call, but forgot to add it for usb
otherwise adding a mapped usb device only works on the node where the
gui is connected to

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/API2/Cluster/Mapping/USB.pm

index 5495bce270f886eef2b6d86740e335ae8fc26f25..763d5c2ba25b0766f29fb405568ab2f5c914390b 100644 (file)
@@ -15,6 +15,11 @@ __PACKAGE__->register_method ({
     name => 'index',
     path => '',
     method => 'GET',
+    # only proxy if we give the 'check-node' parameter
+    proxyto_callback => sub {
+       my ($rpcenv, $proxyto, $param) = @_;
+       return $param->{'check-node'} // 'localhost';
+    },
     description => "List USB Hardware Mappings",
     permissions => {
        description => "Only lists entries where you have 'Mapping.Modify', 'Mapping.Use' or".