cli_monitor: consider instance count in quota check

In the start command when checking, whether the quota is enough to create
the new instance, consider the count of instances that should be started.
This commit is contained in:
Stefan Kalkowski 2013-10-18 14:12:12 +02:00 committed by Christian Helmuth
parent 59d6157441
commit d4922f9071
1 changed files with 3 additions and 2 deletions

View File

@ -129,8 +129,9 @@ struct Start_command : Command
cmd.parameter("--ram", ram);
cmd.parameter("--ram-limit", ram_limit);
size_t preserve_ram = 1*1024*1024;
if (ram + preserve_ram > Genode::env()->ram_session()->avail()) {
/* acount for cli_monitor local metadata */
size_t preserve_ram = 100*1024;
if (count * (ram + preserve_ram) > Genode::env()->ram_session()->avail()) {
tprintf(terminal, "Error: RAM quota exceeds available quota\n");
return;
}