mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-25 02:50:08 +03:00
Bug #2418: Fix quota rollback for vm resize when the VM is owned by another user
This commit is contained in:
parent
e0c70c49fd
commit
5f04549bb7
@ -1628,6 +1628,8 @@ void VirtualMachineResize::request_execute(xmlrpc_c::paramList const& paramList,
|
||||
return;
|
||||
}
|
||||
|
||||
RequestAttributes att_rollback(vm_perms.uid, vm_perms.gid, att);
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* Check & update host capacity */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -1645,7 +1647,7 @@ void VirtualMachineResize::request_execute(xmlrpc_c::paramList const& paramList,
|
||||
get_error(object_name(PoolObjectSQL::HOST),hid),
|
||||
att);
|
||||
|
||||
quota_rollback(&deltas, Quotas::VM, att);
|
||||
quota_rollback(&deltas, Quotas::VM, att_rollback);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -1661,7 +1663,7 @@ void VirtualMachineResize::request_execute(xmlrpc_c::paramList const& paramList,
|
||||
|
||||
host->unlock();
|
||||
|
||||
quota_rollback(&deltas, Quotas::VM, att);
|
||||
quota_rollback(&deltas, Quotas::VM, att_rollback);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -1685,7 +1687,7 @@ void VirtualMachineResize::request_execute(xmlrpc_c::paramList const& paramList,
|
||||
get_error(object_name(PoolObjectSQL::VM),id),
|
||||
att);
|
||||
|
||||
quota_rollback(&deltas, Quotas::VM, att);
|
||||
quota_rollback(&deltas, Quotas::VM, att_rollback);
|
||||
|
||||
if (hid != -1)
|
||||
{
|
||||
@ -1736,7 +1738,7 @@ void VirtualMachineResize::request_execute(xmlrpc_c::paramList const& paramList,
|
||||
|
||||
vm->unlock();
|
||||
|
||||
quota_rollback(&deltas, Quotas::VM, att);
|
||||
quota_rollback(&deltas, Quotas::VM, att_rollback);
|
||||
|
||||
if (hid != -1)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user