Query.Server: Fix GHC 7.8 `bitSize` deprecation warning

This makes Ganeti compile on GHC 7.8 with our -Werror.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Fix API doc

...by also removing the unused parameter from the doc string.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Niklas Hambuechen <niklash@google.com>
ConfigReader: Simplify `initConfigReader` argument passing

We passed in a cfg_transform and an IORef, just to apply the
cfg_transform and write it to the IORef.

Instead, directly pass in a function that decides what to do
with the read config, so that `ConfigReader` now is solely
responsible for reading the config, not for writing it somewhere.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
JQScheduler: Allow triggering scheduler if config changes

Some changes to the config need the scheduler to be re-run,
e.g. when job filters change.

This commit adds the infrastructure for that, with no things
triggering rescheduling.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
JQScheduler: Run scheduler when filters change in config

Until now, job filters being added, modified, or deleted triggered
a scheduler run (`scheduleSomeJobs`) from the place where the filter
modification request is handled (Query.Server).

This could lead to a race:
If the config change containing the updated filters doesn't propagate
fast enough (it is asynchronous), `scheduleSomeJobs` will be triggered
with the old config.

This race only showed up in QAs with larger clusters.

This commit fixes the issue by moving the re-scheduling from the
request-for-config-change location to the place where the
new config is read, so that old and new filters can be compared.

Signed-off-by: Niklas Hambuechen <niklash@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>