[pve-devel] [PATCH qemu-server 5/6] vzdump: warn if non-template backups contains no disk

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Sep 1 15:24:30 CEST 2017


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 PVE/VZDump/QemuServer.pm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm
index ba15d48..527b66f 100644
--- a/PVE/VZDump/QemuServer.pm
+++ b/PVE/VZDump/QemuServer.pm
@@ -253,7 +253,8 @@ sub archive {
 
     my $diskcount = scalar(@{$task->{disks}});
 
-    if (PVE::QemuConfig->is_template($self->{vmlist}->{$vmid}) || !$diskcount) {
+    my $is_template = PVE::QemuConfig->is_template($self->{vmlist}->{$vmid});
+    if ($is_template || !$diskcount) {
 	my @pathlist;
 	foreach my $di (@{$task->{disks}}) {
 	    if ($di->{type} eq 'block' || $di->{type} eq 'file') {
@@ -264,7 +265,11 @@ sub archive {
 	}
 
 	if (!$diskcount) {
-	    $self->loginfo("backup contains no disks");
+	    if ($is_template) {
+		$self->loginfo("backup of template contains no disks");
+	    } else {
+		$self->log('warn', "backup contains no disks");
+	    }
 	}
 
 	my $outcmd;
-- 
2.11.0





More information about the pve-devel mailing list