[pve-devel] [PATCH pve-manager v2 4/4] network-interface-pinning: add if prefix to list of allowed prefixes
Stefan Hanreich
s.hanreich at proxmox.com
Thu Jul 24 11:34:59 CEST 2025
'if' has been added as a possible prefix for physical nics in
pve-common. Add it as a possible prefix for pinning network interfaces
here as well.
Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
PVE/CLI/proxmox_network_interface_pinning.pm | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/PVE/CLI/proxmox_network_interface_pinning.pm b/PVE/CLI/proxmox_network_interface_pinning.pm
index 357a78544..e2ad8c69f 100644
--- a/PVE/CLI/proxmox_network_interface_pinning.pm
+++ b/PVE/CLI/proxmox_network_interface_pinning.pm
@@ -359,7 +359,6 @@ __PACKAGE__->register_method({
parameters => {
additionalProperties => 0,
properties => {
- # TODO: support a target name or prefix once pve-common supports generic physical ifaces
interface => {
description => 'Only pin a specific interface.',
type => 'string',
@@ -367,10 +366,17 @@ __PACKAGE__->register_method({
default => '<all>', # just for the docs.
optional => 1,
},
+ prefix => {
+ description => 'Only pin a specific interface.',
+ type => 'string',
+ enum => ['nic', 'if'],
+ default => 'nic', # just for the docs.
+ optional => 1,
+ },
'target-name' => {
description => 'Pin the interface to a specific name',
type => 'string',
- pattern => 'nic\d+',
+ pattern => '(?:nic|if)\d+',
optional => 1,
},
},
@@ -398,7 +404,7 @@ __PACKAGE__->register_method({
}
my $code = sub {
- my $prefix = 'nic'; # TODO: make flexible once pve-common supports that.
+ my $prefix = $params->{prefix} // 'nic';
my $ip_links = get_ip_links();
my $pinned = get_pinned();
--
2.39.5
More information about the pve-devel
mailing list