Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

On-demand accounting

30 bytes added, 08:56, 25 December 2007
m
Current accounting model: use source tag
== Current accounting model ==
Basically allocation of any kind of resource looks like this:
<presource lang="c">
struct some_resource *get_the_resource(int amount)
{
return ret;
}
</presource>
We change this behaviour to work like this:
<presource lang="c">
struct some_resource *get_the_resource(int amount)
{
return NULL;
}
</presource>
The <code>charge_beancounter()</code> call is responsible for checking whether the user is allowed to get the requested amount of the resource, i.e. if the resource consumption level is lower than the limit set.