From: Fiona Ebner <f.ebner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Philipp Hufnagl <p.hufnagl@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager] fix #474: allow transfer from container/vms
Date: Wed, 9 Aug 2023 13:32:55 +0200 [thread overview]
Message-ID: <a3ea6ca3-9e48-9b93-7c9e-4ba137880275@proxmox.com> (raw)
In-Reply-To: <20230808091342.637190-1-p.hufnagl@proxmox.com>
Am 08.08.23 um 11:13 schrieb Philipp Hufnagl:
> When a member of 2 pools wants to transfer a
> vm/container to an other pool they can not do that. The vv/container would
> have first to be removed form the current pool resulting in a loss of
> privileges of the pool member for this vm/contianer. This feature introduces
> a way to transfer a vm between pools, guarded by a checkbox from accidental
> transfers
>
Nit: there's an additional space at the start of each line, also some
typos, e.g. vv/contianer
> Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
> ---
> PVE/API2/Pool.pm | 19 +++++++++++++++++--
> www/manager6/grid/PoolMembers.js | 17 ++++++++++++++---
> 2 files changed, 31 insertions(+), 5 deletions(-)
The backend and UI changes should be two different patches.
>
> diff --git a/PVE/API2/Pool.pm b/PVE/API2/Pool.pm
> index 007fc815..2f69911a 100644
> --- a/PVE/API2/Pool.pm
> +++ b/PVE/API2/Pool.pm
> @@ -131,6 +131,11 @@ __PACKAGE__->register_method ({
> type => 'string', format => 'pve-storage-id-list',
> optional => 1,
> },
> + transfer => {
> + description => "Allow transfering vms to another pool.",
s/transfering vms/transferring VMs/
> + type => 'boolean',
> + optional => 1,
> + },
> delete => {
> description => "Remove vms/storage (instead of adding it).",
> type => 'boolean',
> @@ -165,8 +170,18 @@ __PACKAGE__->register_method ({
> } else {
> die "VM $vmid is already a pool member\n" if $pool_config->{vms}->{$vmid};
> my $existing_pool = $usercfg->{vms}->{$vmid};
> - die "VM $vmid belongs already to pool '$existing_pool'\n" if defined($existing_pool);
> -
> + if(defined($existing_pool) )
> + {
> + if($param->{transfer})
Style nit: both ifs are missing a space after the keyword, the upper one
has a space too much before the parenthesis. The curly braces should be
on the same line
> + {
> + my $existing_pool_config = $usercfg->{pools}->{$existing_pool};
The permission for the original pool should be checked here?! Or is that
already done somewhere?
> + delete $existing_pool_config->{vms}->{$vmid};
> + }
> + else
> + {
Style nit: should be } else {
> + die "VM $vmid belongs already to pool '$existing_pool' and transfer is not set\n";
> + }
> + }
> $pool_config->{vms}->{$vmid} = 1;
> $usercfg->{vms}->{$vmid} = $pool;
> }
next prev parent reply other threads:[~2023-08-09 11:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-08 9:13 Philipp Hufnagl
2023-08-09 11:32 ` Fiona Ebner [this message]
2023-08-09 14:20 ` Philipp Hufnagl
2023-08-10 7:16 ` Fiona Ebner
2023-08-10 9:47 ` Philipp Hufnagl
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=a3ea6ca3-9e48-9b93-7c9e-4ba137880275@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=p.hufnagl@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.