mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-04-29 23:11:04 +00:00
config: revamp NoWrite interface
instead of blessing a passed-in config and returning it, explicitly only bless without returning to make it more obvious to callers that this affects the argument. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
3d32c4e588
commit
275a6f477c
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user