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

Alexandre Derumier aderumier at odiso.com
Fri Aug 29 08:04:58 CEST 2014


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 <aderumier at odiso.com>
---
 PVE/QemuServer.pm |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 327ea35..e00a063 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -4596,6 +4596,7 @@ my $snapshot_copy_config = sub {
 	next if $k eq 'lock';
 	next if $k eq 'digest';
 	next if $k eq 'description';
+	next if $k eq 'machine';
 	next if $k =~ m/^unused\d+$/;
 
 	$dest->{$k} = $source->{$k};
@@ -4612,7 +4613,7 @@ my $snapshot_apply_config = sub {
 
     # keep description and list of unused disks
     foreach my $k (keys %$conf) {
-	next if !($k =~ m/^unused\d+$/ || $k eq 'description');
+	next if !($k =~ m/^unused\d+$/ || $k eq 'description' || $k eq 'machine');
 	$newconf->{$k} = $conf->{$k};
     }
 
-- 
1.7.10.4




More information about the pve-devel mailing list