diff --git a/PVE/QemuConfig/NoWrite.pm b/PVE/QemuConfig/NoWrite.pm index f697506f..02e5f158 100644 --- a/PVE/QemuConfig/NoWrite.pm +++ b/PVE/QemuConfig/NoWrite.pm @@ -7,12 +7,10 @@ use PVE::RESTEnvironment qw(log_warn); use base qw(PVE::QemuConfig); -sub new { +sub mark_config { my ($class, $conf) = @_; bless($conf, $class); - - return $conf; } sub write_config { diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index b23b79e1..9d06ac8b 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -3398,7 +3398,6 @@ sub config_to_command { bios => $conf->{bios}, # so efidisk gets included if it exists name => $conf->{name}, # so it's correct in the process list }; - $newconf = PVE::QemuConfig::NoWrite->new($newconf); # copy all disks over for my $device (PVE::QemuServer::Drive::valid_drive_names()) { @@ -3407,6 +3406,9 @@ sub config_to_command { # remaining configs stay default + # mark config to prevent writing it out + PVE::QemuConfig::NoWrite->mark_config($newconf); + $conf = $newconf; }