[pve-devel] [PATCH] vmstate snapshot : do no write machine to running config

Dietmar Maurer dietmar at proxmox.com
Fri Aug 29 10:21:32 CEST 2014


What do you thing about this (looks more obvious to me)?

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 327ea35..b4358b0 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -4741,6 +4741,8 @@ my $snapshot_commit = sub {
        die "missing snapshot lock\n"
            if !($conf->{lock} && $conf->{lock} eq 'snapshot');
 
+       my $has_machine_config = defined($conf->{machine});
+
        my $snap = $conf->{snapshots}->{$snapname};
 
        die "snapshot '$snapname' does not exist\n" if !defined($snap);
@@ -4753,6 +4755,8 @@ my $snapshot_commit = sub {
 
        my $newconf = &$snapshot_apply_config($conf, $snap);
 
+       delete $newconf->{machine} if !$has_machine_config;
+
        $newconf->{parent} = $snapname;
 
        update_config_nolock($vmid, $newconf, 1);

> >>For example, in snapshot_rollback(),$forcemachine is wrong because you
> >>do not copy machine config with snapshot_apply_config() ....
> 
> I just send a patch,
> 
> we just need to take $forcemachine from snapshot machine value, and not
> current config.


More information about the pve-devel mailing list