From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Dominik Csapak <d.csapak@proxmox.com>,
Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Christoph Heiss <c.heiss@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager/widget-toolkit 0/2] show altenative interface names in the web ui
Date: Tue, 15 Jul 2025 10:54:49 +0200 [thread overview]
Message-ID: <2b2ba728-7699-4423-96c5-8a7528ed8c93@proxmox.com> (raw)
In-Reply-To: <7a91c329-0faf-446e-a23c-21cb817d63ba@proxmox.com>
Am 15.07.25 um 10:36 schrieb Dominik Csapak:
> On 7/15/25 10:17, Thomas Lamprecht wrote:
>>
>>> calculated for *each*, so e.g. if i have
>>> nicX, nicY and nicZ all point to the same device, we'd have to make the altname list generation
>>> more complicated
>>>
>>>
>>> IMHO it would be ok to always show the 'canonical' name (whatever ip link/kernel says)
>>> in the 'name' column and everything else in the 'altname' column regardless what is
>>> configured in /e/n/i
>>
>> There is no real canonical name, there's a legacy name that might be
>> called primary one, but as one can use the others transparently for it
>> we really must not think to much into that terminology, it's as first
>> class as the other names.
>
> i would interpret the name the kernel has (e.g. what is in /proc/net/dev) as the 'canonical name' ?
> please correct me if i'm wrong about that though
Those files and folders will always use the legacy name with the
stricter naming length limits for not surprising any older tool
with the more flexible newer naming,
That's why legacy name might slightly the better term for these,
but as they will stay basically forever it's probably not really
useful to make that distinction either.
Most users won't do much directly with these files, and if they are
likely to be a bit more experienced to figure out this distinction.
Most users, even technical ones, will use iproute2 tools if they
can avoid poking /proc or /sys and especially the less experienced
one only will check /e/n/i and ip addr/link when they run into trouble,
which is they main underlying reason I want to show the altnames in
that config view, so that their live gets a little bit easier by seeing
what "iface XYZ" stanza they will need to adapt independent of the (alt)
name used. And as one can use all names with iproute2 already this has
the nice side effect of adding feature parity and consistency with a
side benefit of a smaller chance for broken upgrades on systemd naming
scheme policy changes.
> ok then we have to think about how to organize the altnames structure properly
> otherwise it's a PITA to map from the name in the /e/n/i to all others
>
>
> (this is all implementation detail of course, but does make a bit of a headache)
> currently we have a hash with collections of 'altname' => 'what ip link reports'
> but in the case we have altnames in the /e/n/i, we'd actually need the a list of names that are
> equivalent, and that either as a list to search through, or duplicated for each iface name that it
> can reference, so e.g.
>
>
> if we have nicX, nicY, nicZ all alternatives to each other, now we have:
> {
> 'nicY' => 'nicX',
> 'nicZ' => 'nicX',
> }
>
> but we actually want something like this?
>
> {
> 'nicX' => ['nixY', 'nicZ'],
> 'nicY' => ['nicX', 'nicZ'],
> 'nicZ' => ['nicX', 'nicY'],
> }
>
>
> because when we want to show the alternative names of e.g. nicY the first structure is a bit bad to
> search through
>
So we basically have to start with a hash of all names from /e/n/i as keys
and an empty array, then go through the keys and values of the altname map
and add every name (independnt of "primary" = key or "altname" one of the
values for that entry where the /e/n/i name matches one of the keys or values.
fwiw, the API could already add more info if you want to future proof it
w.r.t. putting a distinction between legacy/primary name and altnames.
{
'e-n-i-name' => {
'primary' => '...',
'altnames' => ['...'],
},
...
}
That way we would be flexible with adapting the UI to user feedback while
keeping the API as is. For now we could just merge all primary and altname
with the e-n-i name filtered out in a renderer for the new column.
_______________________________________________
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-15 8:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-14 10:42 Dominik Csapak
2025-07-14 10:42 ` [pve-devel] [PATCH widget-toolkit 1/1] network: optionally show alternative interface names Dominik Csapak
2025-07-14 10:42 ` [pve-devel] [PATCH pve-manager 1/1] api/ui: show/return " Dominik Csapak
2025-07-14 13:49 ` [pve-devel] [PATCH manager/widget-toolkit 0/2] show altenative interface names in the web ui Christoph Heiss
2025-07-14 13:53 ` Dominik Csapak
2025-07-14 14:31 ` Thomas Lamprecht
2025-07-15 7:41 ` Dominik Csapak
2025-07-15 8:17 ` Thomas Lamprecht
2025-07-15 8:36 ` Dominik Csapak
2025-07-15 8:54 ` Thomas Lamprecht [this message]
2025-07-15 9:00 ` Dominik Csapak
2025-07-15 9:01 ` Thomas Lamprecht
2025-07-15 9:08 ` [pve-devel] superseded: " Dominik Csapak
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=2b2ba728-7699-4423-96c5-8a7528ed8c93@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=c.heiss@proxmox.com \
--cc=d.csapak@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