[pve-devel] [PATCH] remove vm access permissions after destroy

Alen Grizonic a.grizonic at proxmox.com
Thu Aug 13 12:21:36 CEST 2015


removed duplicated code which was used in
PVE::AccessControl -> now in PVE::API2::Qemu

Signed-off-by: Alen Grizonic <a.grizonic at proxmox.com>
---
 PVE/API2/Qemu.pm | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index fae2872..b48df1b 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;
 
@@ -1203,7 +1192,7 @@ __PACKAGE__->register_method({
 
 	    PVE::QemuServer::vm_destroy($storecfg, $vmid, $skiplock);
 
-	    PVE::AccessControl::remove_vm_from_pool($vmid);
+	    PVE::AccessControl::remove_vm_access($vmid);
 	};
 
 	return $rpcenv->fork_worker('qmdestroy', $vmid, $authuser, $realcmd);
-- 
2.1.4





More information about the pve-devel mailing list