From 7a1a85edb68d22f16379bbb3afea13d07c6ea7d1 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Mon, 20 Jun 2022 18:34:44 +0200 Subject: [PATCH] B #5867: Fix quotas and fsck co-author: Pavel Czerny (cherry picked from commit e2d4141599ae98f8961023842f7e27a71b05e6e9) --- include/LifeCycleManager.h | 2 +- include/VirtualMachine.h | 5 +- include/VirtualMachineDisk.h | 2 +- src/dm/DispatchManagerActions.cc | 10 +- src/lcm/LifeCycleActions.cc | 34 ++++--- src/lcm/LifeCycleStates.cc | 123 +++++++++++++++++++++---- src/onedb/fsck/host.rb | 6 +- src/onedb/fsck/quotas.rb | 10 ++ src/rm/RequestManagerAllocate.cc | 9 ++ src/rm/RequestManagerVirtualMachine.cc | 13 +++ src/vm/VirtualMachine.cc | 29 ++++-- src/vm/VirtualMachineDisk.cc | 8 +- src/vm/VirtualMachineSystemSnapshot.cc | 8 +- 13 files changed, 200 insertions(+), 59 deletions(-) diff --git a/include/LifeCycleManager.h b/include/LifeCycleManager.h index 33c1f2c615..a4e2703c2d 100644 --- a/include/LifeCycleManager.h +++ b/include/LifeCycleManager.h @@ -242,7 +242,7 @@ private: * image may need to be set to error state. */ void clean_up_vm(VirtualMachine *vm, bool dispose, int& image_id, - int uid, int gid, int req_id); + int uid, int gid, int req_id, Template& quota_tmpl); }; #endif /*LIFE_CYCLE_MANAGER_H_*/ diff --git a/include/VirtualMachine.h b/include/VirtualMachine.h index 96b565ab2d..d08c0dc24c 100644 --- a/include/VirtualMachine.h +++ b/include/VirtualMachine.h @@ -1539,7 +1539,7 @@ public: * @param vm_quotas The SYSTEM_DISK_SIZE freed by the deleted snapshots * @param ds_quotas The DS SIZE freed from image datastores. */ - void delete_non_persistent_disk_snapshots(Template **vm_quotas, + void delete_non_persistent_disk_snapshots(Template& vm_quotas, std::vector