mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-06-15 13:12:15 +00:00
vzdump: skip all special sections
Also log an informational message just like for pending and snapshot sections. Add a comment about it to parse_vm_config() in the hope that the behavior is noted when introducing a future special section. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> Link: https://lore.proxmox.com/20250127112923.31703-9-f.ebner@proxmox.com
This commit is contained in:
parent
d4208c7cc6
commit
d295ea9a28
@ -2198,6 +2198,7 @@ sub parse_vm_config {
|
|||||||
|
|
||||||
return if !defined($raw);
|
return if !defined($raw);
|
||||||
|
|
||||||
|
# note that pending, snapshot and special sections are currently skipped when a backup is taken
|
||||||
my $res = {
|
my $res = {
|
||||||
digest => Digest::SHA::sha1_hex($raw),
|
digest => Digest::SHA::sha1_hex($raw),
|
||||||
snapshots => {},
|
snapshots => {},
|
||||||
|
@ -232,20 +232,21 @@ sub assemble {
|
|||||||
|
|
||||||
my $found_snapshot;
|
my $found_snapshot;
|
||||||
my $found_pending;
|
my $found_pending;
|
||||||
my $found_cloudinit;
|
my $found_special;
|
||||||
while (defined (my $line = <$conffd>)) {
|
while (defined (my $line = <$conffd>)) {
|
||||||
next if $line =~ m/^\#vzdump\#/; # just to be sure
|
next if $line =~ m/^\#vzdump\#/; # just to be sure
|
||||||
next if $line =~ m/^\#qmdump\#/; # just to be sure
|
next if $line =~ m/^\#qmdump\#/; # just to be sure
|
||||||
if ($line =~ m/^\[(.*)\]\s*$/) {
|
if ($line =~ m/^\[(.*)\]\s*$/) {
|
||||||
if ($1 =~ m/^PENDING$/i) {
|
if ($1 =~ m/^PENDING$/i) {
|
||||||
$found_pending = 1;
|
$found_pending = 1;
|
||||||
} elsif ($1 =~ m/^special:cloudinit$/) {
|
} elsif ($1 =~ m/^special:.*$/) {
|
||||||
$found_cloudinit = 1;
|
$found_special = 1;
|
||||||
} else {
|
} else {
|
||||||
$found_snapshot = 1;
|
$found_snapshot = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
next if $found_snapshot || $found_pending || $found_cloudinit; # skip all snapshots,pending changes and cloudinit config data
|
# skip all snapshots, pending changes and special sections
|
||||||
|
next if $found_snapshot || $found_pending || $found_special;
|
||||||
|
|
||||||
if ($line =~ m/^unused\d+:\s*(\S+)\s*/) {
|
if ($line =~ m/^unused\d+:\s*(\S+)\s*/) {
|
||||||
$self->loginfo("skip unused drive '$1' (not included into backup)");
|
$self->loginfo("skip unused drive '$1' (not included into backup)");
|
||||||
@ -266,6 +267,9 @@ sub assemble {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($found_special) {
|
||||||
|
$self->loginfo("special config section found (not included into backup)");
|
||||||
|
}
|
||||||
if ($found_snapshot) {
|
if ($found_snapshot) {
|
||||||
$self->loginfo("snapshots found (not included into backup)");
|
$self->loginfo("snapshots found (not included into backup)");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user