[pve-devel] [PATCH qemu-server] fix #987: don't detect pending changes as snapshots
Fabian Grünbichler
f.gruenbichler at proxmox.com
Mon May 9 12:59:13 CEST 2016
when copying the VM configuration in vzdump. instead detect
them as pending changes and warn about them separately.
---
PVE/VZDump/QemuServer.pm | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm
index e6f0560..616391b 100644
--- a/PVE/VZDump/QemuServer.pm
+++ b/PVE/VZDump/QemuServer.pm
@@ -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;
}
--
2.1.4
More information about the pve-devel
mailing list