X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=qmextract;h=1466a586d9163ec31c3f7976a07a6046f3f64f7e;hb=f0f30448f9b56b8c0f7c93f5157b49e3ceda4267;hp=d6ee32907d3283afe0cc6488a6f7364abdac7d25;hpb=990fc5e22e7c173d43cc30a4862fececa1b18cfc;p=qemu-server.git diff --git a/qmextract b/qmextract index d6ee329..1466a58 100755 --- a/qmextract +++ b/qmextract @@ -8,8 +8,9 @@ use IO::File; use PVE::INotify; use PVE::JSONSchema; use PVE::Tools; -use PVE::Cluster qw(cfs_read_file); +use PVE::Cluster; use PVE::RPCEnvironment; +use PVE::Storage; use PVE::QemuServer; $ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin'; @@ -160,7 +161,7 @@ sub extract_archive { $storeid = $info->{storeid} || 'local'; } - my $cfg = cfs_read_file('storage.cfg'); + my $cfg = PVE::Storage::config(); my $scfg = PVE::Storage::storage_config($cfg, $storeid); my $alloc_size = int(($filesize + 1024 - 1)/1024); @@ -190,8 +191,8 @@ sub extract_archive { exec 'dd', 'ibs=256K', 'obs=256K', "of=$path"; die "couldn't exec dd: $!\n"; } else { - exec '/usr/lib/qemu-server/sparsecp', $path; - die "couldn't exec sparsecp: $!\n"; + exec '/bin/cp', '--sparse=always', '/dev/stdin', $path; + die "couldn't exec cp: $!\n"; } }