public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH container 3/4] filter by content type when using vdisk_list
Date: Mon, 22 Mar 2021 15:32:42 +0100	[thread overview]
Message-ID: <20210322143243.6606-3-f.ebner@proxmox.com> (raw)
In-Reply-To: <20210322143243.6606-1-f.ebner@proxmox.com>

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>
---

Dependency bump for pve-storage is needed.

 src/PVE/LXC.pm | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 6395d12..7e6f378 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -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);
 
-- 
2.20.1





  parent reply	other threads:[~2021-03-22 14:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22 14:32 [pve-devel] [PATCH storage 1/4] Revert "vdisk list: only collect images from storages with an appropriate content type" Fabian Ebner
2021-03-22 14:32 ` [pve-devel] [PATCH storage 2/4] vdisk list: allow specifying content type Fabian Ebner
2021-03-31  8:26   ` [pve-devel] applied: " Thomas Lamprecht
2021-03-22 14:32 ` Fabian Ebner [this message]
2021-04-18 16:05   ` [pve-devel] applied: [PATCH container 3/4] filter by content type when using vdisk_list Thomas Lamprecht
2021-03-22 14:32 ` [pve-devel] [PATCH qemu-server 4/4] " Fabian Ebner
2021-04-18 16:05   ` [pve-devel] applied: " Thomas Lamprecht
2021-03-31  8:26 ` [pve-devel] applied: [PATCH storage 1/4] Revert "vdisk list: only collect images from storages with an appropriate content type" Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210322143243.6606-3-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal