From: Stefan Hanreich <s.hanreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-manager 4/4] network-interface-pinning: add if prefix to list of allowed prefixes
Date: Thu, 24 Jul 2025 11:32:24 +0200 [thread overview]
Message-ID: <20250724093224.70863-5-s.hanreich@proxmox.com> (raw)
In-Reply-To: <20250724093224.70863-1-s.hanreich@proxmox.com>
'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@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 1c042f843..71ac0291b 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
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-07-24 9:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-24 9:32 [pve-devel] [PATCH manager 0/4] improvements to proxmox-network-interface-pinning Stefan Hanreich
2025-07-24 9:32 ` [pve-devel] [PATCH pve-manager 1/4] network-interface-pinning: use ifindex as order for pinning Stefan Hanreich
2025-07-24 9:32 ` [pve-devel] [PATCH pve-manager 2/4] network-interface-pinning: improve printing mapping Stefan Hanreich
2025-07-24 9:32 ` [pve-devel] [PATCH pve-manager 3/4] network-interface-pinning: add target-name parameter Stefan Hanreich
2025-07-24 9:32 ` Stefan Hanreich [this message]
2025-07-24 9:35 ` [pve-devel] superseded: [PATCH manager 0/4] improvements to proxmox-network-interface-pinning Stefan Hanreich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250724093224.70863-5-s.hanreich@proxmox.com \
--to=s.hanreich@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox