mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-02 15:18:44 +00:00
move test for block device to vmtar.c
This commit is contained in:
parent
15fa30e3ec
commit
3e21388903
@ -382,15 +382,8 @@ sub archive {
|
||||
|
||||
my $fh;
|
||||
|
||||
my $sparse = '';
|
||||
|
||||
# no sparse file scan for block devices
|
||||
# no sparse file scan when we use compression
|
||||
# but we enable it for files
|
||||
|
||||
my @filea = ($conffile, 'qemu-server.conf'); # always first file in tar
|
||||
foreach my $di (@{$task->{disks}}) {
|
||||
$sparse = '-s' if !$comp && $di->{type} eq 'file';
|
||||
if ($di->{type} eq 'block' || $di->{type} eq 'file') {
|
||||
push @filea, $di->{snappath}, $di->{filename};
|
||||
} else {
|
||||
@ -400,6 +393,9 @@ sub archive {
|
||||
|
||||
my $files = join (' ', map { "'$_'" } @filea);
|
||||
|
||||
# no sparse file scan when we use compression
|
||||
my $sparse = $comp ? '' : '-s';
|
||||
|
||||
my $cmd = "/usr/lib/qemu-server/vmtar $sparse $files";
|
||||
my $bwl = $opts->{bwlimit}*1024; # bandwidth limit for cstream
|
||||
$cmd .= "|cstream -t $bwl" if $opts->{bwlimit};
|
||||
|
Loading…
Reference in New Issue
Block a user