From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id CC01A1FF16F for ; Tue, 14 Oct 2025 15:22:22 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id EC9673CB6; Tue, 14 Oct 2025 15:22:21 +0200 (CEST) From: Christoph Heiss To: pve-devel@lists.proxmox.com Date: Tue, 14 Oct 2025 15:21:48 +0200 Message-ID: <20251014132207.1171073-4-c.heiss@proxmox.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251014132207.1171073-1-c.heiss@proxmox.com> References: <20251014132207.1171073-1-c.heiss@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1760448095839 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.038 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH installer 03/14] run env: network: add kernel driver name to network interface info X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" This information is already available in the GUI, this makes it possible to show it in the TUI too. Signed-off-by: Christoph Heiss --- Proxmox/Install/RunEnv.pm | 7 +++++++ .../fqdn_from_dhcp_no_default_domain.run-env.json | 9 +++++++++ .../parse_answer_fail/no_fqdn_from_dhcp.run-env.json | 9 +++++++++ proxmox-auto-installer/tests/resources/run-env-info.json | 9 +++++++++ proxmox-installer-common/src/options.rs | 2 ++ proxmox-installer-common/src/setup.rs | 3 +++ 6 files changed, 39 insertions(+) diff --git a/Proxmox/Install/RunEnv.pm b/Proxmox/Install/RunEnv.pm index f0fa6ec..40a9621 100644 --- a/Proxmox/Install/RunEnv.pm +++ b/Proxmox/Install/RunEnv.pm @@ -72,6 +72,9 @@ sub query_cpu_info : prototype() { # mac => , # index => , # name => , +# state => , +# pinned_id => , +# driver => , # addresses => [ # family => , # address => , @@ -113,12 +116,16 @@ my sub query_netdevs : prototype() { } } + my $driver = readlink "/sys/class/net/$name/device/driver" || 'unknown'; + $driver =~ s!^.*/!!; + $ifs->{$name} = { index => $index, name => $name, pinned_id => "${pinned_counter}", mac => $mac, state => uc($state), + driver => $driver, }; $ifs->{$name}->{addresses} = \@valid_addrs if @valid_addrs; diff --git a/proxmox-auto-installer/tests/resources/parse_answer_fail/fqdn_from_dhcp_no_default_domain.run-env.json b/proxmox-auto-installer/tests/resources/parse_answer_fail/fqdn_from_dhcp_no_default_domain.run-env.json index e7c2205..4c41c13 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer_fail/fqdn_from_dhcp_no_default_domain.run-env.json +++ b/proxmox-auto-installer/tests/resources/parse_answer_fail/fqdn_from_dhcp_no_default_domain.run-env.json @@ -182,6 +182,7 @@ "mac": "b4:2e:99:ac:ad:b4", "name": "eno1", "state": "UP", + "driver": "igb", "pinned_id": "0" }, "eno2": { @@ -189,6 +190,7 @@ "mac": "b4:2e:99:ac:ad:b5", "name": "eno2", "state": "UP", + "driver": "igb", "pinned_id": "1" }, "enp129s0f0np0": { @@ -196,6 +198,7 @@ "mac": "1c:34:da:5c:5e:24", "name": "enp129s0f0np0", "state": "DOWN", + "driver": "mlx5_core", "pinned_id": "2" }, "enp129s0f1np1": { @@ -203,6 +206,7 @@ "mac": "1c:34:da:5c:5e:25", "name": "enp129s0f1np1", "state": "DOWN", + "driver": "mlx5_core", "pinned_id": "3" }, "enp193s0f0np0": { @@ -210,6 +214,7 @@ "mac": "24:8a:07:1e:05:bc", "name": "enp193s0f0np0", "state": "UP", + "driver": "mlx5_core", "pinned_id": "4" }, "enp193s0f1np1": { @@ -217,6 +222,7 @@ "mac": "24:8a:07:1e:05:bd", "name": "enp193s0f1np1", "state": "DOWN", + "driver": "mlx5_core", "pinned_id": "5" }, "enp65s0f0": { @@ -224,6 +230,7 @@ "mac": "a0:36:9f:0a:b3:82", "name": "enp65s0f0", "state": "DOWN", + "driver": "igb", "pinned_id": "6" }, "enp65s0f1": { @@ -231,6 +238,7 @@ "mac": "a0:36:9f:0a:b3:83", "name": "enp65s0f1", "state": "DOWN", + "driver": "igb", "pinned_id": "7" }, "enx5a4732ddc747": { @@ -238,6 +246,7 @@ "mac": "5a:47:32:dd:c7:47", "name": "enx5a4732ddc747", "state": "UNKNOWN", + "driver": "cdc_ether", "pinned_id": "8" } }, diff --git a/proxmox-auto-installer/tests/resources/parse_answer_fail/no_fqdn_from_dhcp.run-env.json b/proxmox-auto-installer/tests/resources/parse_answer_fail/no_fqdn_from_dhcp.run-env.json index 47d7bde..fa4e834 100644 --- a/proxmox-auto-installer/tests/resources/parse_answer_fail/no_fqdn_from_dhcp.run-env.json +++ b/proxmox-auto-installer/tests/resources/parse_answer_fail/no_fqdn_from_dhcp.run-env.json @@ -181,6 +181,7 @@ "mac": "b4:2e:99:ac:ad:b4", "name": "eno1", "state": "UP", + "driver": "igb", "pinned_id": "0" }, "eno2": { @@ -188,6 +189,7 @@ "mac": "b4:2e:99:ac:ad:b5", "name": "eno2", "state": "UP", + "driver": "igb", "pinned_id": "1" }, "enp129s0f0np0": { @@ -195,6 +197,7 @@ "mac": "1c:34:da:5c:5e:24", "name": "enp129s0f0np0", "state": "DOWN", + "driver": "mlx5_core", "pinned_id": "2" }, "enp129s0f1np1": { @@ -202,6 +205,7 @@ "mac": "1c:34:da:5c:5e:25", "name": "enp129s0f1np1", "state": "DOWN", + "driver": "mlx5_core", "pinned_id": "3" }, "enp193s0f0np0": { @@ -209,6 +213,7 @@ "mac": "24:8a:07:1e:05:bc", "name": "enp193s0f0np0", "state": "UP", + "driver": "mlx5_core", "pinned_id": "4" }, "enp193s0f1np1": { @@ -216,6 +221,7 @@ "mac": "24:8a:07:1e:05:bd", "name": "enp193s0f1np1", "state": "DOWN", + "driver": "mlx5_core", "pinned_id": "5" }, "enp65s0f0": { @@ -223,6 +229,7 @@ "mac": "a0:36:9f:0a:b3:82", "name": "enp65s0f0", "state": "DOWN", + "driver": "igb", "pinned_id": "6" }, "enp65s0f1": { @@ -230,6 +237,7 @@ "mac": "a0:36:9f:0a:b3:83", "name": "enp65s0f1", "state": "DOWN", + "driver": "igb", "pinned_id": "7" }, "enx5a4732ddc747": { @@ -237,6 +245,7 @@ "mac": "5a:47:32:dd:c7:47", "name": "enx5a4732ddc747", "state": "UNKNOWN", + "driver": "cdc_ether", "pinned_id": "8" } }, diff --git a/proxmox-auto-installer/tests/resources/run-env-info.json b/proxmox-auto-installer/tests/resources/run-env-info.json index 5291721..add5f2a 100644 --- a/proxmox-auto-installer/tests/resources/run-env-info.json +++ b/proxmox-auto-installer/tests/resources/run-env-info.json @@ -182,6 +182,7 @@ "mac": "b4:2e:99:ac:ad:b4", "name": "eno1", "state": "UP", + "driver": "igb", "pinned_id": "0" }, "eno2": { @@ -189,6 +190,7 @@ "mac": "b4:2e:99:ac:ad:b5", "name": "eno2", "state": "UP", + "driver": "igb", "pinned_id": "1" }, "enp129s0f0np0": { @@ -196,6 +198,7 @@ "mac": "1c:34:da:5c:5e:24", "name": "enp129s0f0np0", "state": "DOWN", + "driver": "mlx5_core", "pinned_id": "2" }, "enp129s0f1np1": { @@ -203,6 +206,7 @@ "mac": "1c:34:da:5c:5e:25", "name": "enp129s0f1np1", "state": "DOWN", + "driver": "mlx5_core", "pinned_id": "3" }, "enp193s0f0np0": { @@ -210,6 +214,7 @@ "mac": "24:8a:07:1e:05:bc", "name": "enp193s0f0np0", "state": "UP", + "driver": "mlx5_core", "pinned_id": "4" }, "enp193s0f1np1": { @@ -217,6 +222,7 @@ "mac": "24:8a:07:1e:05:bd", "name": "enp193s0f1np1", "state": "DOWN", + "driver": "mlx5_core", "pinned_id": "5" }, "enp65s0f0": { @@ -224,6 +230,7 @@ "mac": "a0:36:9f:0a:b3:82", "name": "enp65s0f0", "state": "DOWN", + "driver": "igb", "pinned_id": "6" }, "enp65s0f1": { @@ -231,6 +238,7 @@ "mac": "a0:36:9f:0a:b3:83", "name": "enp65s0f1", "state": "DOWN", + "driver": "igb", "pinned_id": "7" }, "enx5a4732ddc747": { @@ -238,6 +246,7 @@ "mac": "5a:47:32:dd:c7:47", "name": "enx5a4732ddc747", "state": "UNKNOWN", + "driver": "cdc_ether", "pinned_id": "8" } }, diff --git a/proxmox-installer-common/src/options.rs b/proxmox-installer-common/src/options.rs index 48c77c9..50fd74e 100644 --- a/proxmox-installer-common/src/options.rs +++ b/proxmox-installer-common/src/options.rs @@ -677,6 +677,7 @@ mod tests { name: "eth0".to_owned(), index: 0, state: InterfaceState::Up, + driver: "dummy".to_owned(), mac: "01:23:45:67:89:ab".to_owned(), addresses: Some(vec![ CidrAddress::new(Ipv4Addr::new(192, 168, 0, 2), 24).unwrap(), @@ -804,6 +805,7 @@ mod tests { name: "eth0".to_owned(), index: 0, state: InterfaceState::Up, + driver: "dummy".to_owned(), mac: "01:23:45:67:89:ab".to_owned(), addresses: None, }, diff --git a/proxmox-installer-common/src/setup.rs b/proxmox-installer-common/src/setup.rs index 66cea72..4fda39d 100644 --- a/proxmox-installer-common/src/setup.rs +++ b/proxmox-installer-common/src/setup.rs @@ -473,6 +473,9 @@ pub struct Interface { pub state: InterfaceState, + /// Kernel driver name that claims this interface. + pub driver: String, + #[serde(default)] #[serde(deserialize_with = "deserialize_cidr_list")] pub addresses: Option>, -- 2.51.0 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel