From 6f1c754fe4f100976caee2f90a84ad15ea7ae346 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 31 Aug 2015 16:42:34 +0200 Subject: [PATCH] use loop device for all 'raw' formated disks on directory based storage --- src/PVE/LXC.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index a07fbbe..b47c562 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -1873,8 +1873,7 @@ sub attach_loops { my ($vtype, undef, undef, undef, undef, $isBase, $format) = PVE::Storage::parse_volname($storage_cfg, $volid); - if (($format ne 'subvol') && - ($scfg->{type} eq 'dir' || $scfg->{type} eq 'nfs')) { + if ($format eq 'raw' && $scfg->{path}) { my $path = PVE::Storage::path($storage_cfg, $volid, $snapname); my $loopdev; @@ -1904,7 +1903,7 @@ sub dettach_loops { my ($vtype, undef, undef, undef, undef, $isBase, $format) = PVE::Storage::parse_volname($storage_cfg, $volid); - if($format ne 'subvol' && ($scfg->{type} eq 'dir' || $scfg->{type} eq 'nfs')) { + if ($format eq 'raw' && $scfg->{path}) { my $path = PVE::Storage::path($storage_cfg, $volid, $snapname); foreach my $dev (keys %$loopdevs){ PVE::Tools::run_command(['losetup', '-d', $dev]) if $loopdevs->{$dev} eq $path; -- 2.39.2