summaryrefslogtreecommitdiffstats
path: root/tools/crm_simulate.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:45:40 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:45:40 +0000
commit07d7f4cfa4b10de87a31b68191036ff446add675 (patch)
tree7162524d8aaf1aef62d2f4fa51f595ed113981ff /tools/crm_simulate.c
parentAdding upstream version 2.1.6. (diff)
downloadpacemaker-07d7f4cfa4b10de87a31b68191036ff446add675.tar.xz
pacemaker-07d7f4cfa4b10de87a31b68191036ff446add675.zip
Adding upstream version 2.1.7.upstream/2.1.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tools/crm_simulate.c')
-rw-r--r--tools/crm_simulate.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/tools/crm_simulate.c b/tools/crm_simulate.c
index 932c5bd..aab4110 100644
--- a/tools/crm_simulate.c
+++ b/tools/crm_simulate.c
@@ -29,6 +29,7 @@
#include <crm/common/util.h>
#include <crm/common/iso8601.h>
#include <crm/pengine/status.h>
+#include <crm/pengine/internal.h>
#include <pacemaker-internal.h>
#include <pacemaker.h>
@@ -450,7 +451,7 @@ int
main(int argc, char **argv)
{
int rc = pcmk_rc_ok;
- pe_working_set_t *data_set = NULL;
+ pcmk_scheduler_t *scheduler = NULL;
pcmk__output_t *out = NULL;
GError *error = NULL;
@@ -513,24 +514,26 @@ main(int argc, char **argv)
#endif
}
- data_set = pe_new_working_set();
- if (data_set == NULL) {
+ scheduler = pe_new_working_set();
+ if (scheduler == NULL) {
rc = ENOMEM;
- g_set_error(&error, PCMK__RC_ERROR, rc, "Could not allocate working set");
+ g_set_error(&error, PCMK__RC_ERROR, rc,
+ "Could not allocate scheduler data");
goto done;
}
if (pcmk_is_set(options.flags, pcmk_sim_show_scores)) {
- pe__set_working_set_flags(data_set, pe_flag_show_scores);
+ pe__set_working_set_flags(scheduler, pcmk_sched_output_scores);
}
if (pcmk_is_set(options.flags, pcmk_sim_show_utilization)) {
- pe__set_working_set_flags(data_set, pe_flag_show_utilization);
+ pe__set_working_set_flags(scheduler, pcmk_sched_show_utilization);
}
- pe__set_working_set_flags(data_set, pe_flag_no_compat);
+ pe__set_working_set_flags(scheduler, pcmk_sched_no_compat);
if (options.test_dir != NULL) {
- data_set->priv = out;
- pcmk__profile_dir(options.test_dir, options.repeat, data_set, options.use_date);
+ scheduler->priv = out;
+ pcmk__profile_dir(options.test_dir, options.repeat, scheduler,
+ options.use_date);
rc = pcmk_rc_ok;
goto done;
}
@@ -542,9 +545,9 @@ main(int argc, char **argv)
goto done;
}
- rc = pcmk__simulate(data_set, out, options.injections, options.flags, section_opts,
- options.use_date, options.input_file, options.graph_file,
- options.dot_file);
+ rc = pcmk__simulate(scheduler, out, options.injections, options.flags,
+ section_opts, options.use_date, options.input_file,
+ options.graph_file, options.dot_file);
done:
pcmk__output_and_clear_error(&error, NULL);
@@ -562,8 +565,8 @@ main(int argc, char **argv)
pcmk__free_arg_context(context);
g_strfreev(processed_args);
- if (data_set) {
- pe_free_working_set(data_set);
+ if (scheduler != NULL) {
+ pe_free_working_set(scheduler);
}
fflush(stderr);