From: Moayad <m.alma...@proxmox.com>

Signed-off-by: Moayad <m.alma...@proxmox.com>
---
 PVE/VZDump.pm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 3caa7ab8..0f04d4db 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -405,6 +405,10 @@ sub new {
        }
     }
 
+    if (defined($opts->{pigz})) {
+       $opts->{pigz} = 
PVE::JSONSchema::parse_property_string(PVE::VZDump::Common::get_pigzdesc(), 
$opts->{pigz});
+    }
+
     $opts->{dumpdir} =~ s|/+$|| if ($opts->{dumpdir});
     $opts->{tmpdir} =~ s|/+$|| if ($opts->{tmpdir});
 
@@ -582,8 +586,8 @@ sub compressor_info {
     } elsif ($opt_compress eq '1' || $opt_compress eq 'lzo') {
        return ('lzop', 'lzo');
     } elsif ($opt_compress eq 'gzip') {
-       if ($opts->{pigz} > 0) {
-           my $pigz_threads = $opts->{pigz};
+       if (defined($opts->{pigz}) && $opts->{pigz}->{threads} > 0) {
+           my $pigz_threads = $opts->{pigz}->{threads};
            if ($pigz_threads == 1) {
                my $cpuinfo = PVE::ProcFSTools::read_cpuinfo();
                $pigz_threads = int(($cpuinfo->{cpus} + 1)/2);
-- 
2.20.1

_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to