]> git.proxmox.com Git - pve-container.git/commitdiff
filter by content type when using vdisk_list
authorFabian Ebner <f.ebner@proxmox.com>
Mon, 22 Mar 2021 14:32:42 +0000 (15:32 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 18 Apr 2021 16:05:12 +0000 (18:05 +0200)
except for migration, where it would be subtly backwards-incompatible.

Also allows to get rid of the existing filtering hack in rescan().

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
src/PVE/LXC.pm

index 6395d12814452b35ad2a9a545839f2c432b97258..7e6f3784712b4667ec8da9a5df068ffb12d0a398 100644 (file)
@@ -836,7 +836,7 @@ sub destroy_lxc_container {
     });
 
     if ($purge_unreferenced) { # also remove unreferenced disk
-       my $vmdisks = PVE::Storage::vdisk_list($storage_cfg, undef, $vmid);
+       my $vmdisks = PVE::Storage::vdisk_list($storage_cfg, undef, $vmid, undef, 'rootdir');
        PVE::Storage::foreach_volid($vmdisks, sub {
            my ($volid, $sid, $volname, $d) = @_;
            eval { PVE::Storage::vdisk_free($storage_cfg, $volid) };
@@ -2042,7 +2042,7 @@ sub update_unused {
 sub scan_volids {
     my ($cfg, $vmid) = @_;
 
-    my $info = PVE::Storage::vdisk_list($cfg, undef, $vmid);
+    my $info = PVE::Storage::vdisk_list($cfg, undef, $vmid, undef, 'rootdir');
 
     my $all_volumes = {};
     foreach my $storeid (keys %$info) {
@@ -2062,12 +2062,6 @@ sub rescan {
 
     my $cfg = PVE::Storage::config();
 
-    # FIXME: Remove once our RBD plugin can handle CT and VM on a single storage
-    # see: https://pve.proxmox.com/pipermail/pve-devel/2018-July/032900.html
-    foreach my $stor (keys %{$cfg->{ids}}) {
-       delete($cfg->{ids}->{$stor}) if !$cfg->{ids}->{$stor}->{content}->{rootdir};
-    }
-
     print "rescan volumes...\n";
     my $all_volumes = scan_volids($cfg, $vmid);