1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-25 23:21:29 +03:00

F #3503: Fix calculation of FREE_CPUs after updating ISOLCPUS

This commit is contained in:
Ruben S. Montero 2019-07-29 16:08:43 +02:00
parent 4ca50f7519
commit d4b1a66860
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -617,6 +617,7 @@ void HostShareNode::reserve_cpus(const std::string& cpu_ids)
struct Core &c = jt->second;
unsigned int fcpus = 0;
unsigned int ucpus = 0;
for (auto kt = c.cpus.begin(); kt != c.cpus.end(); ++kt)
{
@ -624,9 +625,13 @@ void HostShareNode::reserve_cpus(const std::string& cpu_ids)
{
fcpus++;
}
else if ( kt->second >= 0 )
{
ucpus++;
}
}
if ( c.free_cpus == 0 && fcpus != 0) //CORE policy
if ( c.free_cpus == 0 && ucpus == 1) //CORE policy
{
continue;
}