public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH installer v4 19/30] gui: network: add vlan setup options to advanced network dialog
Date: Mon,  2 Nov 2026 13:45:25 +0100	[thread overview]
Message-ID: <20261102124539.1008075-20-c.heiss@proxmox.com> (raw)
In-Reply-To: <20261102124539.1008075-1-c.heiss@proxmox.com>

Fixes #2164 [0].

Adds a third frame to the advanced network options dialog, allowing to
set a VLAN ID for the management interface.

[0] https://bugzilla.proxmox.com/show_bug.cgi?id=2164

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
Changes v3 -> v4:
  * don't expand checkbox and grid, which resulted in unnecessary padding
    and dialog size

Changes v2 -> v3:
  * new patch

 proxinstall | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)

diff --git a/proxinstall b/proxinstall
index a676018..2622871 100755
--- a/proxinstall
+++ b/proxinstall
@@ -87,6 +87,7 @@ my @steps = (
 # GUI global variables
 my $gtk_state = {
     network_bonding_enabled => 0,
+    network_vlan_enabled => 0,
 };
 
 my $target_hds; # only for the summary view
@@ -641,6 +642,64 @@ my sub create_network_bond_frame {
     return ($frame, $refresh_if_names, $on_done);
 }
 
+my sub create_network_vlan_frame {
+    my $frame = Gtk3::Frame->new('Management VLAN');
+
+    my $vbox = Gtk3::Box->new('vertical', 5);
+    $frame->add($vbox);
+    $vbox->set_margin_start(10);
+    $vbox->set_margin_end(10);
+    $vbox->set_margin_top(5);
+    $vbox->set_margin_bottom(5);
+
+    my $enable_checkbox = Gtk3::CheckButton->new('Enable VLAN setup on management interface');
+    $enable_checkbox->set_active($gtk_state->{network_vlan_enabled});
+    $vbox->pack_start($enable_checkbox, 1, 0, 5);
+
+    my $vlan_opts = Proxmox::Install::Config::get_mngmt_vlan_opt();
+
+    my $initial_vid = $vlan_opts->{vid} > 0 ? $vlan_opts->{vid} : 1;
+    my $vid_adjustment = Gtk3::Adjustment->new($initial_vid, 2, 4095, 1, 1, 1);
+    my $vid_input = Gtk3::SpinButton->new($vid_adjustment, 1, 0);
+    $vid_input->set_tooltip_text('Must be between 2 and 4094 inclusive.');
+
+    my $opts_grid = $create_label_widget_grid->([
+        ['VLAN tag', $vid_input],
+    ]);
+
+    $vbox->pack_start($opts_grid, 0, 0, 5);
+
+    my $set_sensitive = sub {
+        my ($active) = @_;
+
+        $opts_grid->foreach(sub {
+            $_[0]->set_sensitive($active);
+        });
+    };
+    $set_sensitive->($gtk_state->{network_vlan_enabled});
+
+    $enable_checkbox->signal_connect(
+        toggled => sub {
+            my $active = !!$enable_checkbox->get_active();
+
+            $gtk_state->{network_vlan_enabled} = $active;
+            $set_sensitive->($active);
+        },
+    );
+
+    my $on_done = sub {
+        if (!$enable_checkbox->get_active()) {
+            Proxmox::Install::Config::set_mngmt_vlan_opt('enabled', 0);
+            return;
+        }
+
+        Proxmox::Install::Config::set_mngmt_vlan_opt('vid', $vid_input->get_value_as_int());
+        Proxmox::Install::Config::set_mngmt_vlan_opt('enabled', 1);
+    };
+
+    return ($frame, $on_done);
+}
+
 my sub create_network_advanced_options_view {
     my ($done_cb) = @_;
 
@@ -661,9 +720,11 @@ my sub create_network_advanced_options_view {
 
     my ($bond_frame, $bond_refresh, $bond_on_done) = create_network_bond_frame();
     my ($pin_frame, $pin_on_done) = create_network_interface_pin_frame($bond_refresh);
+    my ($vlan_frame, $vlan_on_done) = create_network_vlan_frame();
 
     $hbox->pack_start($pin_frame, 0, 0, 10);
     $hbox->pack_start($bond_frame, 0, 0, 10);
+    $hbox->pack_start($vlan_frame, 0, 0, 10);
 
     $scrolled_window->add($hbox);
     $content->pack_start($scrolled_window, 1, 1, 10);
@@ -674,6 +735,7 @@ my sub create_network_advanced_options_view {
             eval {
                 $pin_on_done->();
                 $bond_on_done->();
+                $vlan_on_done->();
             };
             if ($@) {
                 Proxmox::UI::message($@, $dialog);
@@ -1062,6 +1124,11 @@ sub create_ack_view {
             : $iface->{name};
     }
 
+    if (Proxmox::Install::Config::get_mngmt_vlan_enabled()) {
+        my $vid = Proxmox::Install::Config::get_mngmt_vlan_opt('vid');
+        $interface .= ", VLAN $vid";
+    }
+
     my %config_values = (
         __target_hd__ => join(' | ', $target_hds->@*),
         __target_fs__ => Proxmox::Install::Config::get_filesys(),
-- 
2.55.0





  parent reply	other threads:[~2026-11-02 12:48 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 12:45 [PATCH installer/proxmox v4 00/30] fix #2164: add bond setup across all installers Christoph Heiss
2026-11-02 12:45 ` [PATCH proxmox v4 01/30] installer-types: clippy: use .is_multiple_of() instead of manual modulo Christoph Heiss
2026-11-02 12:45 ` [PATCH proxmox v4 02/30] installer-types: use `MacAddress` type where applicable Christoph Heiss
2026-11-02 12:45 ` [PATCH proxmox v4 03/30] installer-types: derive Display for RebootMode and FilterMatch Christoph Heiss
2026-11-02 12:45 ` [PATCH proxmox v4 04/30] installer-types: answer: add options for configuring management bond Christoph Heiss
2026-11-02 12:45 ` [PATCH proxmox v4 05/30] installer-types: answer: add options for configuring management vlan Christoph Heiss
2026-11-02 12:45 ` [PATCH proxmox v4 06/30] installer-types: bump fetch schema for bond and VLAN answer options Christoph Heiss
2026-11-02 12:45 ` [PATCH proxmox v4 07/30] installer-types: bump version to 0.3.0-1 Christoph Heiss
2026-11-02 12:45 ` [PATCH proxmox v4 08/30] network-api: derive Display and FromStr for network bond types Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 09/30] install: run make tidy Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 10/30] tree-wide: use `MacAddress` type instead of string for MAC addresses Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 11/30] install: factor out ifupdown2 config generation into own subroutine Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 12/30] install: do not rely on interface name map to be fully populated Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 13/30] install: config: add option for setting up bond on management interface Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 14/30] install: config: add option for setting up vlan " Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 15/30] install: network: set up management bond if requested Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 16/30] install: network: set up vlan on management interface " Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 17/30] gui: network: factor out name pinning into advanced options dialog Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 18/30] gui: network: add bond setup options to " Christoph Heiss
2026-11-02 12:45 ` Christoph Heiss [this message]
2026-11-02 12:45 ` [PATCH installer v4 20/30] auto: pass through management network bond options to low-level installer Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 21/30] auto: pass through management network vlan " Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 22/30] tui: drop long obsolete comment about logo formatting Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 23/30] tui: views: add widget for displaying a group of checkboxes Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 24/30] tui: network: factor out name pinning into advanced options dialog Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 25/30] tui: network: add bond setup options to advanced network dialog Christoph Heiss
2026-11-02 14:55   ` Lukas Sichert
2026-11-02 12:45 ` [PATCH installer v4 26/30] tui: network: add vlan " Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 27/30] gui: network: split advanced options dialog into tabs Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 28/30] tui: " Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 29/30] gui: network: list bond member candidates sharing a MAC address once Christoph Heiss
2026-11-02 12:45 ` [PATCH installer v4 30/30] tui: " Christoph Heiss

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=20261102124539.1008075-20-c.heiss@proxmox.com \
    --to=c.heiss@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal