* [pve-devel] [PATCH container v2 1/2] fix #7156: setup: separate dns list with semicolons
@ 2025-12-18 15:01 Maximiliano Sandoval
2025-12-18 15:01 ` [pve-devel] [PATCH container v2 2/2] tests: check format for multiple nameservers Maximiliano Sandoval
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Maximiliano Sandoval @ 2025-12-18 15:01 UTC (permalink / raw)
To: pve-devel
Network Manager uses GLib's key file format [1]. While the format allows
either comma or semicolon-separated lists, this choice is global for the
key file and Network Manager declares that their key file uses the
later. As per `man 5 nm-settings-keyfile`:
> lists are separated by character ;
Additionally, tables 6 and 7 from the manual contain examples for dns:
> Example: dns=1.2.3.4;8.8.8.8;8.8.4.4;
> Example: dns=2001:4860:4860::8888;2001:4860:4860::8844;
There are, however, a handful of lists mentioned in the man page which
use a different format:
> some lists of complex values (addresses, routes, routing-rules),
> instead of using a semicolon separated list, use one key-value pair
> per list element, with the key being the singular of the property name
> followed by the numeric index (i.e address1, address2, ...).
so care should be taken when revisiting lists in this context. For
example, routes are not lists per se (they are strings) but they
allow (cf. table 6):
> Example: route1=8.8.8.0/24,10.1.1.1,77
[1] https://docs.gtk.org/glib/struct.KeyFile.html
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
Differences from v1:
- Expanded commit message
- Added a tests
@thomas, when running `make test` on src/test I get:
```
# ...
TEST test-centos10-001 => OK
# ...
All tests successful.
Files=1, Tests=5, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.19 cusr 0.02 csys = 0.22 CPU)
Result: PASS
```
but I am not sure if I am missing anything.
src/PVE/LXC/Setup/CentOS.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/PVE/LXC/Setup/CentOS.pm b/src/PVE/LXC/Setup/CentOS.pm
index 0826977..7bccca2 100644
--- a/src/PVE/LXC/Setup/CentOS.pm
+++ b/src/PVE/LXC/Setup/CentOS.pm
@@ -244,7 +244,7 @@ sub setup_network_with_networkmanager {
}
}
if (@name_servers_v4) {
- $data .= "dns=" . join(',', @name_servers_v4) . "\n";
+ $data .= "dns=" . join(';', @name_servers_v4) . "\n";
$data .= "dns-search=" . join(' ', PVE::Tools::split_list($searchdomains)) . "\n"
if $searchdomains;
}
@@ -270,7 +270,7 @@ sub setup_network_with_networkmanager {
}
}
if (@name_servers_v6) {
- $data .= "dns=" . join(',', @name_servers_v6) . "\n";
+ $data .= "dns=" . join(';', @name_servers_v6) . "\n";
$data .= "dns-search=" . join(' ', PVE::Tools::split_list($searchdomains)) . "\n"
if $searchdomains;
}
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] [PATCH container v2 2/2] tests: check format for multiple nameservers
2025-12-18 15:01 [pve-devel] [PATCH container v2 1/2] fix #7156: setup: separate dns list with semicolons Maximiliano Sandoval
@ 2025-12-18 15:01 ` Maximiliano Sandoval
2025-12-18 15:10 ` [pve-devel] [PATCH container v2 1/2] fix #7156: setup: separate dns list with semicolons Thomas Lamprecht
2025-12-18 15:11 ` [pve-devel] applied: " Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Maximiliano Sandoval @ 2025-12-18 15:01 UTC (permalink / raw)
To: pve-devel
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
src/test/test-centos10-001/config | 2 +-
.../etc/NetworkManager/system-connections/eth0.nmconnection.exp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/test/test-centos10-001/config b/src/test/test-centos10-001/config
index c332df1..a461a88 100644
--- a/src/test/test-centos10-001/config
+++ b/src/test/test-centos10-001/config
@@ -1,4 +1,4 @@
hostname: test1
net0: bridge=vmbr0,name=eth0,ip=dhcp
searchdomain: example.com
-nameserver: 127.0.0.1
+nameserver: 127.0.0.1,192.168.0.1
diff --git a/src/test/test-centos10-001/etc/NetworkManager/system-connections/eth0.nmconnection.exp b/src/test/test-centos10-001/etc/NetworkManager/system-connections/eth0.nmconnection.exp
index 3bf5d2d..d7d7499 100644
--- a/src/test/test-centos10-001/etc/NetworkManager/system-connections/eth0.nmconnection.exp
+++ b/src/test/test-centos10-001/etc/NetworkManager/system-connections/eth0.nmconnection.exp
@@ -5,7 +5,7 @@ type=ethernet
interface-name=eth0
[ipv4]
method=auto
-dns=127.0.0.1
+dns=127.0.0.1;192.168.0.1
dns-search=example.com
[ipv6]
method=disabled
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [pve-devel] [PATCH container v2 1/2] fix #7156: setup: separate dns list with semicolons
2025-12-18 15:01 [pve-devel] [PATCH container v2 1/2] fix #7156: setup: separate dns list with semicolons Maximiliano Sandoval
2025-12-18 15:01 ` [pve-devel] [PATCH container v2 2/2] tests: check format for multiple nameservers Maximiliano Sandoval
@ 2025-12-18 15:10 ` Thomas Lamprecht
2025-12-18 15:11 ` [pve-devel] applied: " Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2025-12-18 15:10 UTC (permalink / raw)
To: Proxmox VE development discussion, Maximiliano Sandoval
On 18/12/2025 16:01, Maximiliano Sandoval wrote:
> @thomas, when running `make test` on src/test I get:
>
> ```
> # ...
> TEST test-centos10-001 => OK
> # ...
> All tests successful.
> Files=1, Tests=5, 0 wallclock secs ( 0.01 usr 0.00 sys + 0.19 cusr 0.02 csys = 0.22 CPU)
> Result: PASS
> ```
>
> but I am not sure if I am missing anything.
seems alright, we simply did not have multiple DNS servers in that
test, so nothing changes.
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pve-devel] applied: [PATCH container v2 1/2] fix #7156: setup: separate dns list with semicolons
2025-12-18 15:01 [pve-devel] [PATCH container v2 1/2] fix #7156: setup: separate dns list with semicolons Maximiliano Sandoval
2025-12-18 15:01 ` [pve-devel] [PATCH container v2 2/2] tests: check format for multiple nameservers Maximiliano Sandoval
2025-12-18 15:10 ` [pve-devel] [PATCH container v2 1/2] fix #7156: setup: separate dns list with semicolons Thomas Lamprecht
@ 2025-12-18 15:11 ` Thomas Lamprecht
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2025-12-18 15:11 UTC (permalink / raw)
To: pve-devel, Maximiliano Sandoval
On Thu, 18 Dec 2025 16:01:24 +0100, Maximiliano Sandoval wrote:
> Network Manager uses GLib's key file format [1]. While the format allows
> either comma or semicolon-separated lists, this choice is global for the
> key file and Network Manager declares that their key file uses the
> later. As per `man 5 nm-settings-keyfile`:
>
> > lists are separated by character ;
>
> [...]
Applied, thanks!
[1/2] fix #7156: setup: separate dns list with semicolons
commit: 6e08c5504add68a2e168b4302abdf8b5484e5cf7
[2/2] tests: check format for multiple nameservers
commit: d94ffdcde0a19f489a8acd9459b38773a663d624
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-12-18 15:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-18 15:01 [pve-devel] [PATCH container v2 1/2] fix #7156: setup: separate dns list with semicolons Maximiliano Sandoval
2025-12-18 15:01 ` [pve-devel] [PATCH container v2 2/2] tests: check format for multiple nameservers Maximiliano Sandoval
2025-12-18 15:10 ` [pve-devel] [PATCH container v2 1/2] fix #7156: setup: separate dns list with semicolons Thomas Lamprecht
2025-12-18 15:11 ` [pve-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox