attempting to write such a config is already a bug, and execution should not
continue in this case. very often a write of the config will be followed by
reloading it, expecting changes to be persisted and possibly missing
re-checking of the original reason for marking the config as NoWrite.

Signed-off-by: Fabian Grünbichler <f.gruenbich...@proxmox.com>
---
this might be a bit opinionated, but I'd rather err on the side of
caution/aborting here..

 PVE/QemuConfig/NoWrite.pm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/PVE/QemuConfig/NoWrite.pm b/PVE/QemuConfig/NoWrite.pm
index 02e5f158..53a34990 100644
--- a/PVE/QemuConfig/NoWrite.pm
+++ b/PVE/QemuConfig/NoWrite.pm
@@ -16,8 +16,7 @@ sub mark_config {
 sub write_config {
     my ($class, $vmid, $conf) = @_;
 
-    log_warn("refusing to write temporary configuration");
-    return;
+    die("refusing to write temporary configuration\n");
 }
 
 1;
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to