public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH guest-common 3/3] fix #6808: abstract config: snapshot delete: improve error when snapshot on volume is missing
Date: Fri, 19 Sep 2025 18:16:36 +0200	[thread overview]
Message-ID: <20250919161651.121424-4-f.ebner@proxmox.com> (raw)
In-Reply-To: <20250919161651.121424-1-f.ebner@proxmox.com>

In case of a ZFS volume the message would be a rather unhelpful:
> zfs error: could not find any snapshots to destroy; check snapshot names.

Mention the volume name and that the force parameter can be used if
desired.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/AbstractConfig.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/PVE/AbstractConfig.pm b/src/PVE/AbstractConfig.pm
index d403021..23f62d4 100644
--- a/src/PVE/AbstractConfig.pm
+++ b/src/PVE/AbstractConfig.pm
@@ -1014,8 +1014,11 @@ sub snapshot_delete {
                     );
                 };
                 if (my $err = $@) {
-                    die $err if !$force;
-                    warn $err;
+                    my $volid_key = $class->volid_key();
+                    my $volid = $volume->{$volid_key};
+                    my $msg = "Removing snapshot '$snapname' from volume $volid failed";
+                    die "${msg}, use '--force' to continue removal. Error was: $err" if !$force;
+                    warn "${msg}, proceeding because '--force' was specified. Error was: $err";
                 }
             }
 
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


      parent reply	other threads:[~2025-09-19 16:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 16:16 [pve-devel] [PATCH-SERIES guest-common 0/3] " Fiona Ebner
2025-09-19 16:16 ` [pve-devel] [PATCH guest-common 1/3] abstract config: order module imports Fiona Ebner
2025-09-19 16:16 ` [pve-devel] [PATCH guest-common 2/3] abstract config: add missing JSONSchema import Fiona Ebner
2025-09-19 16:16 ` Fiona Ebner [this message]

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=20250919161651.121424-4-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