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/RFC storage] prune backups: activate storage
Date: Fri, 16 Apr 2021 10:51:27 +0200	[thread overview]
Message-ID: <20210416085127.17803-1-f.ebner@proxmox.com> (raw)

which also checks whether the storage is even enabled. VZDump jobs already
activate the storage, but more direct calls via API/CLI didn't do so yet.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---

Or should the call rather be made in the API endpoints?

For functions like volume_resize, the callers in qemu-server/pve-container do
the activation via activate_volumes, while for vdisk_* functions the activation
happens directly in the functions.

The snapshot-related functions are also currently missing the activation/enabled
check! Should the callers in guest-common do an activate_volumes call, or should
we do an activate_storage in the functions themselves?

The first appraoch has the advantage of being more efficient (one activation
call for the whole operation) and also more precise (if volume activation itself
is actually needed), while the second one ensures that we do not forget to make
the calls.

 PVE/Storage.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index 122c3e9..a856266 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -1630,6 +1630,8 @@ sub prune_backups {
 	$keep = PVE::JSONSchema::parse_property_string('prune-backups', $scfg->{'prune-backups'});
     }
 
+    activate_storage($cfg, $storeid);
+
     my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
     return $plugin->prune_backups($scfg, $storeid, $keep, $vmid, $type, $dryrun, $logfunc);
 }
-- 
2.20.1





             reply	other threads:[~2021-04-16  8:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16  8:51 Fabian Ebner [this message]
2021-06-14  6:29 ` Fabian Ebner
2021-06-15  8:17 ` [pve-devel] applied: " 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=20210416085127.17803-1-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