public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH container v2] lxc: resize: fix #2790 return message in case of disk already at size
@ 2020-08-26  8:51 Aaron Lauterer
  2020-08-27  7:21 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Aaron Lauterer @ 2020-08-26  8:51 UTC (permalink / raw)
  To: pve-devel

Otherwise the API would return an error message because returning an
empty value is not defined in the API.

By dying we avoid confusions as the return will be an error and not a
successful call which should return a task ID.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
---
v1 -> v2: change from return to die as the result of the feedback to the
first version [0]

We should probably align the resize endpoint on the qemu side
accordingly as right now it has no return values defined at all and does
not return anything in this case.

[0] https://lists.proxmox.com/pipermail/pve-devel/2020-August/044597.html

 src/PVE/API2/LXC.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
index 21899d0..ced3093 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -1674,7 +1674,7 @@ __PACKAGE__->register_method({
 
 	    die "unable to shrink disk size\n" if $newsize < $size;
 
-	    return if $size == $newsize;
+	    die "disk is already at specified size\n" if $size == $newsize;
 
 	    PVE::Cluster::log_msg('info', $authuser, "update CT $vmid: resize --disk $disk --size $sizestr");
 	    my $realcmd = sub {
-- 
2.20.1





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-27  7:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-26  8:51 [pve-devel] [PATCH container v2] lxc: resize: fix #2790 return message in case of disk already at size Aaron Lauterer
2020-08-27  7:21 ` [pve-devel] applied: " Thomas Lamprecht

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