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 container] api: clone: improve error message
Date: Fri, 23 Jan 2026 11:04:29 +0100	[thread overview]
Message-ID: <20260123100647.32406-1-f.ebner@proxmox.com> (raw)

The old message suggests that the container doesn't have any
snapshots, which might not be true. While at it, improve the style by
avoiding the multi-line post-if.

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

diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
index 3d74f71..7841215 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -2039,9 +2039,10 @@ __PACKAGE__->register_method({
                         $rpcenv->check($authuser, "/storage/$sid", ['Datastore.AllocateSpace']);
 
                         if ($full) {
-                            die
-                                "Cannot do full clones on a running container without snapshots\n"
-                                if $running && !defined($snapname);
+                            if ($running && !defined($snapname)) {
+                                die "Full clone of a running container is only possible from a"
+                                    . " snapshot\n";
+                            }
                             $fullclone->{$opt} = 1;
                         } else {
                             # not full means clone instead of copy
-- 
2.47.3



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


             reply	other threads:[~2026-01-23 10:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-23 10:04 Fiona Ebner [this message]
2026-01-23 13:31 ` 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=20260123100647.32406-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