From 7946e0fa42e0d2a53987376324ffc1bb7beb273c Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 29 Aug 2014 11:27:27 +0200 Subject: [PATCH] Currently,if we don't have a "machine" option in running config, and we take a vmstate snapshot the machine option is write in the snapshot (ok), but also in the running config (bad) Signed-off-by: Alexandre Derumier Signed-off-by: Dietmar Maurer --- PVE/QemuServer.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 327ea35b..b4358b08 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);