[pve-devel] [PATCH] remove vm permissions after vm destroy
Alen Grizonic
a.grizonic at proxmox.com
Wed Aug 12 16:11:10 CEST 2015
also removed duplicated code which is used in
PVE::AccessControl and not in PVE::API2::Qemu
Signed-off-by: Alen Grizonic <a.grizonic at proxmox.com>
---
PVE/API2/Qemu.pm | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index fae2872..47ad8a7 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -1185,17 +1185,6 @@ __PACKAGE__->register_method({
my $storecfg = PVE::Storage::config();
- my $delVMfromPoolFn = sub {
- my $usercfg = cfs_read_file("user.cfg");
- if (my $pool = $usercfg->{vms}->{$vmid}) {
- if (my $data = $usercfg->{pools}->{$pool}) {
- delete $data->{vms}->{$vmid};
- delete $usercfg->{vms}->{$vmid};
- cfs_write_file("user.cfg", $usercfg);
- }
- }
- };
-
my $realcmd = sub {
my $upid = shift;
@@ -1204,6 +1193,8 @@ __PACKAGE__->register_method({
PVE::QemuServer::vm_destroy($storecfg, $vmid, $skiplock);
PVE::AccessControl::remove_vm_from_pool($vmid);
+
+ PVE::AccessControl::remove_vm_permissions($vmid);
};
return $rpcenv->fork_worker('qmdestroy', $vmid, $authuser, $realcmd);
--
2.1.4
More information about the pve-devel
mailing list