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.csa...@proxmox.com>
---
 PVE/API2/Cluster/Mapping/USB.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/PVE/API2/Cluster/Mapping/USB.pm b/PVE/API2/Cluster/Mapping/USB.pm
index 5495bce2..763d5c2b 100644
--- a/PVE/API2/Cluster/Mapping/USB.pm
+++ b/PVE/API2/Cluster/Mapping/USB.pm
@@ -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".
-- 
2.30.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to