Commit b03e364e authored by Leigh B Stoller's avatar Leigh B Stoller

Add a check to see if X number of public IPs are available. This is an

unlocked checked, used in the Geni getticket() routine.
parent 0d2c7967
......@@ -4023,5 +4023,21 @@ sub OnRemoteNode($)
return $physhost->isremotenode();
}
#
# Quick check to see if we have routable IPs addresses free.
#
sub HaveRoutableIPs($$)
{
my ($class, $needed) = @_;
my $query_result =
DBQueryWarn("select count(ip) from virt_node_public_addr ".
"where node_id is null and eid is null");
return 0
if (!$query_result || $query_result->numrows < $needed);
return 1;
}
# _Always_ make sure that this 1 is at the end of the file...
1;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment