controller will pass resource <name, value> pair than <idx, value> pair

This commit is contained in:
Rongsong Shen 2026-05-13 07:18:03 +00:00
parent 9f6741c2c4
commit d47b3375e7
16 changed files with 183 additions and 86 deletions

View file

@ -117,7 +117,7 @@ static int xcesched_push_configs(cluster_t* c)
configdata.data.conf4sched->resources = (xce_resource_t**)rlist.data;
collect_shared_resvals(c, NULL, &xreslist);
configdata.data.conf4sched->nresvals = xreslist.count;
configdata.data.conf4sched->resvals = (xce_val_with_idx_t**)xreslist.data;
configdata.data.conf4sched->resvals = (xce_name_val_t**)xreslist.data;
configdata.data.conf4sched->n_ugroups = c->myconf->cluster_config->nugroups;
configdata.data.conf4sched->ugroups = c->myconf->cluster_config->ugroups;
@ -142,8 +142,8 @@ static int xcesched_push_configs(cluster_t* c)
rc = xce_pushconfig_req(c->sched.ep, c->myhost, &configdata);
free_resval_with_idx_list(&(configdata.data.conf4sched->resvals),
configdata.data.conf4sched->nresvals);
free_name_val_list(&(configdata.data.conf4sched->resvals),
configdata.data.conf4sched->nresvals);
FREEUP(configdata.data.conf4sched);
@ -223,7 +223,7 @@ static int xcesched_push_workers(cluster_t* c)
for (i = 0; i < workers.n_total; i++) {
xce_worker_t* w = workers.workers[i];
free_resval_with_idx_list(&(w->resvals_to_sched), w->nresvals_to_sched);
free_name_val_list(&(w->resvals_to_sched), w->nresvals_to_sched);
}
unlock_collect_workers(&wlist);
@ -439,9 +439,9 @@ static int sched_worker_change(int type, int situation, void* data,
situation);
xlist_init(&resvalist, 256);
collect_resval_with_idx(&(w->host.resvals), &resvalist);
collect_resval(c->resmgr, &(w->host.resvals), &resvalist);
w->host.nresvals_to_sched = resvalist.count;
w->host.resvals_to_sched = (xce_val_with_idx_t**)resvalist.data;
w->host.resvals_to_sched = (xce_name_val_t**)resvalist.data;
mylock_lock(&(c->sched.lock));
if (c->sched.ep != NULL) {
@ -460,8 +460,8 @@ static int sched_worker_change(int type, int situation, void* data,
#if 0
/*FIXME*/
free_resval_with_idx_list(&(w->host.resvals_to_sched),
w->host.nresvals_to_sched);
free_name_val_list(&(w->host.resvals_to_sched),
w->host.nresvals_to_sched);
#endif
xlist_fini(&resvalist);