fix #987: don't detect pending changes as snapshots

when copying the VM configuration in vzdump. instead detect
them as pending changes and warn about them separately.
This commit is contained in:
Fabian Grünbichler 2016-05-09 12:59:13 +02:00 committed by Dietmar Maurer
parent e7a5104daa
commit 391c2230d4

View File

@ -180,13 +180,21 @@ sub assemble {
die "unable open '$conffile'";
my $found_snapshot;
my $found_pending;
while (defined (my $line = <$conffd>)) {
next if $line =~ m/^\#vzdump\#/; # just to be sure
next if $line =~ m/^\#qmdump\#/; # just to be sure
if ($line =~ m/^\[.*\]\s*$/) {
$found_snapshot = 1;
if ($line =~ m/^\[(.*)\]\s*$/) {
if ($1 =~ m/PENDING/i) {
$found_pending = 1;
} else {
$found_snapshot = 1;
}
}
next if $found_snapshot; # skip all snapshots data
next if $found_pending; # skip all pending changes
if ($line =~ m/^unused\d+:\s*(\S+)\s*/) {
$self->loginfo("skip unused drive '$1' (not included into backup)");
next;
@ -210,6 +218,10 @@ sub assemble {
$self->loginfo("snapshots found (not included into backup)");
}
if ($found_pending) {
$self->loginfo("pending configuration changes found (not included into backup)");
}
PVE::Tools::file_copy($firewall_src, $firewall_dest) if -f $firewall_src;
}