* [PATCH-SERIES qemu-server/container 0/3] fix #8354: config: gracefully handle empty 'running-nets-host-mtu'
@ 2026-11-20 11:19 Fiona Ebner
2026-11-20 11:19 ` [PATCH qemu-server 1/3] " Fiona Ebner
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Fiona Ebner @ 2026-11-20 11:19 UTC (permalink / raw)
To: pve-devel
For a VM without any VirtIO NICs (or if failing to query via QMP), the
result from get_nets_host_mtu() is an empty string. The schema
verification when writing out the configuration is currently
incomplete and for example, does not check the 'pattern' of a
property. The result verification for a 'qm config' command uses
tighter checks, so it would run into an error for an empty value:
> 400 Result verification failed
> running-nets-host-mtu: value does not match the regex pattern
Avoid writing out an empty 'running-nets-host-mtu' value to the
configuration and ignore it upon parsing to unbreak already written
out values.
Also add a reminder to tighten the checks for a future major release
to avoid such issues in the future.
qemu-server:
Fiona Ebner (2):
fix #8354: config: gracefully handle empty 'running-nets-host-mtu'
config: check type: add reminder to improve checks for major release
src/PVE/QemuConfig.pm | 2 +-
src/PVE/QemuServer.pm | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
container:
Fiona Ebner (1):
config: check type: add reminder to improve checks for major release
src/PVE/LXC/Config.pm | 1 +
1 file changed, 1 insertion(+)
Summary over all repositories:
3 files changed, 7 insertions(+), 1 deletions(-)
--
Generated by git-murpp 0.5.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH qemu-server 1/3] fix #8354: config: gracefully handle empty 'running-nets-host-mtu'
2026-11-20 11:19 [PATCH-SERIES qemu-server/container 0/3] fix #8354: config: gracefully handle empty 'running-nets-host-mtu' Fiona Ebner
@ 2026-11-20 11:19 ` Fiona Ebner
2026-11-20 11:19 ` [PATCH qemu-server 2/3] config: check type: add reminder to improve checks for major release Fiona Ebner
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2026-11-20 11:19 UTC (permalink / raw)
To: pve-devel
For a VM without any VirtIO NICs (or if failing to query via QMP), the
result from get_nets_host_mtu() is an empty string. The schema
verification when writing out the configuration is currently
incomplete and for example, does not check the 'pattern' of a
property. The result verification for a 'qm config' command uses
tighter checks, so it would run into an error for an empty value:
> 400 Result verification failed
> running-nets-host-mtu: value does not match the regex pattern
Avoid writing out an empty 'running-nets-host-mtu' value to the
configuration and ignore it upon parsing to unbreak already written
out values.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuConfig.pm | 2 +-
src/PVE/QemuServer.pm | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/PVE/QemuConfig.pm b/src/PVE/QemuConfig.pm
index e7adfbfb..29a4b8b3 100644
--- a/src/PVE/QemuConfig.pm
+++ b/src/PVE/QemuConfig.pm
@@ -274,7 +274,7 @@ sub __snapshot_save_vmstate {
$conf->{vmstate} = $statefile;
$conf->{runningmachine} = $runningmachine;
$conf->{runningcpu} = $runningcpu;
- $conf->{'running-nets-host-mtu'} = $nets_host_mtu;
+ $conf->{'running-nets-host-mtu'} = $nets_host_mtu if $nets_host_mtu;
return $statefile;
}
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index c14b7f51..763cfd39 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -2021,6 +2021,10 @@ sub parse_vm_config {
} elsif ($line =~ m/^([a-z][a-z_\-]*\d*):\s*(.+?)\s*$/) {
my $key = $1;
my $value = $2;
+
+ # Ignore accidentally written empty 'running-nets-host-mtu'.
+ next if $key eq 'running-nets-host-mtu' && $value !~ m/\S/;
+
if ($section->{name} eq 'cloudinit' && $section->{type} eq 'special') {
# ignore validation only used for informative purpose
$conf->{$key} = $value;
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH qemu-server 2/3] config: check type: add reminder to improve checks for major release
2026-11-20 11:19 [PATCH-SERIES qemu-server/container 0/3] fix #8354: config: gracefully handle empty 'running-nets-host-mtu' Fiona Ebner
2026-11-20 11:19 ` [PATCH qemu-server 1/3] " Fiona Ebner
@ 2026-11-20 11:19 ` Fiona Ebner
2026-11-20 11:19 ` [PATCH container 3/3] " Fiona Ebner
2026-11-20 12:00 ` applied: [PATCH-SERIES qemu-server/container 0/3] fix #8354: config: gracefully handle empty 'running-nets-host-mtu' Thomas Lamprecht
3 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2026-11-20 11:19 UTC (permalink / raw)
To: pve-devel
The check_type() implementation for VM configuration handling is
less complete compared to the one from JSONSchema and does not cover
checking 'pattern', 'minimum', 'enum', etc.
There could be some fallout from tightening the checks, so it might
be better to wait until the next major release.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuServer.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 763cfd39..268716f8 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -1776,6 +1776,7 @@ sub cloudinit_pending_properties {
return $p;
}
+# FIXME: MAJOR VERSION: use JSONSchema::check_type (or check_prop?) to check 'pattern', etc.
sub check_type {
my ($key, $value, $schema) = @_;
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH container 3/3] config: check type: add reminder to improve checks for major release
2026-11-20 11:19 [PATCH-SERIES qemu-server/container 0/3] fix #8354: config: gracefully handle empty 'running-nets-host-mtu' Fiona Ebner
2026-11-20 11:19 ` [PATCH qemu-server 1/3] " Fiona Ebner
2026-11-20 11:19 ` [PATCH qemu-server 2/3] config: check type: add reminder to improve checks for major release Fiona Ebner
@ 2026-11-20 11:19 ` Fiona Ebner
2026-11-20 12:00 ` applied: [PATCH-SERIES qemu-server/container 0/3] fix #8354: config: gracefully handle empty 'running-nets-host-mtu' Thomas Lamprecht
3 siblings, 0 replies; 5+ messages in thread
From: Fiona Ebner @ 2026-11-20 11:19 UTC (permalink / raw)
To: pve-devel
The check_type() implementation for container configuration handling
is less complete compared to the one from JSONSchema and does not
cover checking 'pattern', 'minimum', 'enum', etc.
There could be some fallout from tightening the checks, so it might
be better to wait until the next major release.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/LXC/Config.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
index 2441b2f..d0b0c85 100644
--- a/src/PVE/LXC/Config.pm
+++ b/src/PVE/LXC/Config.pm
@@ -1441,6 +1441,7 @@ sub update_pct_config {
return $errors;
}
+# FIXME: MAJOR VERSION: use JSONSchema::check_type (or check_prop?) to check 'pattern', etc.
sub check_type {
my ($class, $key, $value) = @_;
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* applied: [PATCH-SERIES qemu-server/container 0/3] fix #8354: config: gracefully handle empty 'running-nets-host-mtu'
2026-11-20 11:19 [PATCH-SERIES qemu-server/container 0/3] fix #8354: config: gracefully handle empty 'running-nets-host-mtu' Fiona Ebner
` (2 preceding siblings ...)
2026-11-20 11:19 ` [PATCH container 3/3] " Fiona Ebner
@ 2026-11-20 12:00 ` Thomas Lamprecht
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Lamprecht @ 2026-11-20 12:00 UTC (permalink / raw)
To: pve-devel, Fiona Ebner
On Fri, 20 Nov 2026 12:19:15 +0100, Fiona Ebner wrote:
> For a VM without any VirtIO NICs (or if failing to query via QMP), the
> result from get_nets_host_mtu() is an empty string. The schema
> verification when writing out the configuration is currently
> incomplete and for example, does not check the 'pattern' of a
> property. The result verification for a 'qm config' command uses
> tighter checks, so it would run into an error for an empty value:
> > 400 Result verification failed
> > running-nets-host-mtu: value does not match the regex pattern
>
> [...]
Applied, thanks!
[qemu-server]
[1/2] fix #8354: config: gracefully handle empty 'running-nets-host-mtu'
https://git.proxmox.com/?p=qemu-server.git;a=commitdiff;h=b8c8a36d41eb1d94ee7d730e7be2e0387f650d16
[2/2] config: check type: add reminder to improve checks for major release
https://git.proxmox.com/?p=qemu-server.git;a=commitdiff;h=ae1f72ff1ee8bad8bd13dbf82ec21feeddffbfd1
[container]
[1/1] config: check type: add reminder to improve checks for major release
https://git.proxmox.com/?p=qemu-server.git;a=commitdiff;h=ae1f72ff1ee8bad8bd13dbf82ec21feeddffbfd1
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-20 12:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 11:19 [PATCH-SERIES qemu-server/container 0/3] fix #8354: config: gracefully handle empty 'running-nets-host-mtu' Fiona Ebner
2026-11-20 11:19 ` [PATCH qemu-server 1/3] " Fiona Ebner
2026-11-20 11:19 ` [PATCH qemu-server 2/3] config: check type: add reminder to improve checks for major release Fiona Ebner
2026-11-20 11:19 ` [PATCH container 3/3] " Fiona Ebner
2026-11-20 12:00 ` applied: [PATCH-SERIES qemu-server/container 0/3] fix #8354: config: gracefully handle empty 'running-nets-host-mtu' Thomas Lamprecht
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.