[pve-devel] [PATCH qemu-server v4 01/12] usb: mapping: move implementation of find_on_current_node here
Dominik Csapak
d.csapak at proxmox.com
Thu Jun 6 11:22:02 CEST 2024
this was the only user, and it's easy enough
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
no changes
PVE/QemuServer/USB.pm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/PVE/QemuServer/USB.pm b/PVE/QemuServer/USB.pm
index 49957444..ecd0361d 100644
--- a/PVE/QemuServer/USB.pm
+++ b/PVE/QemuServer/USB.pm
@@ -5,6 +5,7 @@ use warnings;
use PVE::QemuServer::PCI qw(print_pci_addr);
use PVE::QemuServer::Machine;
use PVE::QemuServer::Helpers qw(min_version windows_version);
+use PVE::INotify;
use PVE::JSONSchema;
use PVE::Mapping::USB;
use base 'Exporter';
@@ -91,7 +92,9 @@ sub parse_usb_device {
$res->{spice} = 1;
}
} elsif (defined($mapping)) {
- my $devices = PVE::Mapping::USB::find_on_current_node($mapping);
+ my $config = PVE::Mapping::USB::config();
+ my $node = PVE::INotify::nodename();
+ my $devices = PVE::Mapping::USB::get_node_mapping($config, $mapping, $node);
die "USB device mapping not found for '$mapping'\n" if !$devices || !scalar($devices->@*);
die "More than one USB mapping per host not supported\n" if scalar($devices->@*) > 1;
eval {
--
2.39.2
More information about the pve-devel
mailing list