Host related operations.  
More...
#include <host.h>
#include <logging.h>
#include <scheduler.h>
 
Go to the source code of this file.
 | 
| static int  | print_host_all (gchar *host_name, host_t *host, GOutputStream *ostr) | 
|   | GTraversFunction that allows the information for all hosts to be printed.  More...
  | 
|   | 
| host_t *  | host_init (char *name, char *address, char *agent_dir, int max) | 
|   | Creates a new host, and adds it to the host list.  More...
  | 
|   | 
| void  | host_destroy (host_t *host) | 
|   | Frees and uninitializes any memory associated with the host struct.  More...
  | 
|   | 
| void  | host_insert (host_t *host, scheduler_t *scheduler) | 
|   | Inserts a new host into the scheduler structure.  More...
  | 
|   | 
| void  | host_increase_load (host_t *host) | 
|   | Increase the number of running agents on a host by 1.  More...
  | 
|   | 
| void  | host_decrease_load (host_t *host) | 
|   | Decrease the number of running agents on a host by 1.  More...
  | 
|   | 
| void  | host_print (host_t *host, GOutputStream *ostr) | 
|   | Prints the information about a host to the output stream.  More...
  | 
|   | 
| host_t *  | get_host (GList **queue, uint8_t num) | 
|   | 
| void  | print_host_load (GTree *host_list, GOutputStream *ostr) | 
|   | Prints the host information to ostr.  More...
  | 
|   | 
Host related operations. 
Definition in file host.c.
 
      
        
          | host_t* get_host  | 
          ( | 
          GList **  | 
          queue,  | 
        
        
           | 
           | 
          uint8_t  | 
          num  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Gets a host for which there are at least num agents available to start new agents on.
- Parameters
 - 
  
    | queue | GList of available hosts  | 
    | num | the number of agents to start on the host  | 
  
   
- Returns
 - the host with that number of available slots, NULL if none exist 
 
Definition at line 156 of file host.c.
 
 
      
        
          | void host_decrease_load  | 
          ( | 
          host_t *  | 
          host | ) | 
           | 
        
      
 
Decrease the number of running agents on a host by 1. 
- Parameters
 - 
  
  
 
Definition at line 125 of file host.c.
 
 
      
        
          | void host_destroy  | 
          ( | 
          host_t *  | 
          host | ) | 
           | 
        
      
 
Frees and uninitializes any memory associated with the host struct. 
- Parameters
 - 
  
    | host | The host to free the memory for.  | 
  
   
Definition at line 78 of file host.c.
 
 
      
        
          | void host_increase_load  | 
          ( | 
          host_t *  | 
          host | ) | 
           | 
        
      
 
Increase the number of running agents on a host by 1. 
- Parameters
 - 
  
  
 
Definition at line 114 of file host.c.
 
 
      
        
          | host_t* host_init  | 
          ( | 
          char *  | 
          name,  | 
        
        
           | 
           | 
          char *  | 
          address,  | 
        
        
           | 
           | 
          char *  | 
          agent_dir,  | 
        
        
           | 
           | 
          int  | 
          max  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Creates a new host, and adds it to the host list. 
- Parameters
 - 
  
    | name | The name of the host  | 
    | address | Address that can be passed to ssh when starting agent on host  | 
    | agent_dir | The location of agent binaries on the host  | 
    | max | The max number of agent that can run on this host  | 
  
   
- Returns
 - New host 
 
Definition at line 60 of file host.c.
 
 
Inserts a new host into the scheduler structure. 
- Parameters
 - 
  
    | host | the host that will be added to the scheduler  | 
    | scheduler | the relevant scheduler struct  | 
  
   
Definition at line 103 of file host.c.
 
 
      
        
          | void host_print  | 
          ( | 
          host_t *  | 
          host,  | 
        
        
           | 
           | 
          GOutputStream *  | 
          ostr  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Prints the information about a host to the output stream. 
- Parameters
 - 
  
    | host | the relevant host  | 
    | ostr | the output stream to write to  | 
  
   
Definition at line 137 of file host.c.
 
 
  
  
      
        
          | static int print_host_all  | 
          ( | 
          gchar *  | 
          host_name,  | 
         
        
           | 
           | 
          host_t *  | 
          host,  | 
         
        
           | 
           | 
          GOutputStream *  | 
          ostr  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
static   | 
  
 
GTraversFunction that allows the information for all hosts to be printed. 
- Parameters
 - 
  
    | host_name | the string name of the host  | 
    | host | the host struct paired with the name  | 
    | ostr | the output stream that the info will be printed to  | 
  
   
- Returns
 - 0 to cause the traversal to continue 
 
- See also
 - host_print() 
 
Definition at line 41 of file host.c.
 
 
      
        
          | void print_host_load  | 
          ( | 
          GTree *  | 
          host_list,  | 
        
        
           | 
           | 
          GOutputStream *  | 
          ostr  | 
        
        
           | 
          ) | 
           |  |