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

Alexandre DERUMIER aderumier at odiso.com
Fri Aug 29 11:06:28 CEST 2014


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

Works fine here !
Thanks.

----- Mail original ----- 

De: "Dietmar Maurer" <dietmar at proxmox.com> 
À: "Alexandre DERUMIER" <aderumier at odiso.com> 
Cc: pve-devel at pve.proxmox.com 
Envoyé: Vendredi 29 Août 2014 10:21:32 
Objet: RE: [pve-devel] [PATCH] vmstate snapshot : do no write machine to running config 

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