X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;ds=sidebyside;f=hostinfod%2Fhostinfod.h;fp=hostinfod%2Fhostinfod.h;h=8bb48e69c98c0b5bc12f876b7dfb615f258d2ee6;hb=f71a10c6282c56aac97e8b1651e018e5d63c7a4b;hp=98fcb63a9dcb1ebb2f3e23c80052bca9ac62325c;hpb=b35d7170994157c60410c9d792e0a63ddf912d9b;p=virt-hostinfo.git diff --git a/hostinfod/hostinfod.h b/hostinfod/hostinfod.h index 98fcb63..8bb48e6 100644 --- a/hostinfod/hostinfod.h +++ b/hostinfod/hostinfod.h @@ -28,6 +28,8 @@ #include #include +#include + enum guest_state { guest_state_connecting, /* Connecting to socket. */ guest_state_request, /* Waiting or reading the request. */ @@ -59,6 +61,9 @@ struct guest_description { /* Increments every time guest does something bad, decremented once per min */ unsigned penalty; struct timespec last_penalty_decr; + + /* Hash records last time each command was run by this guest. */ + apr_hash_t *lasttime; }; enum arg_type { @@ -79,14 +84,16 @@ struct arg { extern const char *conf_file; extern char *socket_dir; extern char *guests_file; +extern char *libvirt_uri; +extern int libvirt_uri_set_on_cmdline; extern int verbose; extern int verbose_set_on_cmdline; extern int foreground; extern int foreground_set_on_cmdline; extern int messages_to_stderr; extern apr_pool_t *pool; /* pool for global memory allocation */ - extern void initialize (void); +extern struct timespec *diff_timespec (struct timespec *r, const struct timespec *a, const struct timespec *b); /* r = a - b */ /* error.c */ extern void init_syslog (void); @@ -107,6 +114,7 @@ extern void paprerror (apr_status_t r, const char *fs, ...) /* configuration.c */ extern void read_main_conf_file (void); +extern void check_guests_file (struct guest_description *hval, const char *cmd, double *interval, int *enabled); /* monitor_sockets.c */ extern int sockets_inotify_fd; @@ -141,4 +149,9 @@ typedef void (*command_fn) (struct guest_description *hval, const char *cmd, apr apr_hash_set (commands, #name, APR_HASH_KEY_STRING, cb); \ } +/* virt.c */ +extern void init_libvirt (void); +extern virConnectPtr conn; +extern virNodeInfo nodeinfo; + #endif /* HOSTINFOD_H */