fix bug #502: allow creation of empty vma archives

This commit is contained in:
Dietmar Maurer 2014-04-14 11:21:01 +02:00
parent c0efd8cd0e
commit c82935e92e

View File

@ -233,7 +233,9 @@ sub archive {
$speed = $opts->{bwlimit}*1024;
}
if (PVE::QemuServer::is_template($self->{vmlist}->{$vmid})) {
my $diskcount = scalar(@{$task->{disks}});
if (PVE::QemuServer::is_template($self->{vmlist}->{$vmid}) || !$diskcount) {
my @pathlist;
foreach my $di (@{$task->{disks}}) {
if ($di->{type} eq 'block' || $di->{type} eq 'file') {
@ -243,6 +245,10 @@ sub archive {
}
}
if (!$diskcount) {
$self->loginfo("backup contains no disks");
}
my $outcmd;
if ($comp) {
$outcmd = "exec:$comp";