const frsh_resource_type_t restype_to_find = restype;
struct fcb_contract * fc;
struct res_key * rk;
-
+
+ int ret;
+ fres_contract_ptr_seq *schedulable_contracts;
//TODO: delete debug outputs
/* int num_of_resources = 0;
/* CORBA_sequence_set_release(ids, CORBA_TRUE); */
/* *ids_out = ids; /\* ids is freed by FORB *\/ */
- rebalance_spare_capacity_and_reserve(resource);
+ ret = rebalance_spare_capacity_and_reserve(resource);
+ if (ret) {
+ if (ret == FRSH_ERR_CONTRACT_REJECTED) {
+ ul_logmsg("Contract(s) was/were rejected\n");
+ } else {
+ char msg[100];
+ fres_strerror(ret, msg, sizeof(msg));
+ ul_logerr("Reservation error: %s\n", msg);
+ }
+ goto error;
+ }
+
+ /* Commit contracts */
+ ret = commit_resource(resource, &schedulable_contracts);
+ if (ret) {
+ ul_logmsg("commit_resource bad return value: %d\n", ret);
+ goto error;
+ }
+
+ //ret = fcb_remember_contracts(fcb, fcb_contracts, num);
+ //if (ret) {
+ // ul_logmsg("fcb_remember_contracts: %d\n", ret);
+ // goto error;
+ //}
+
+ ret = fcb_remember_schedulable_contracts(fcb, schedulable_contracts);
+ if (ret) {
+ ul_logmsg("fcb_remember_schedulable_contracts bad return value: %d\n", ret);
+ goto error;
+ }
+
+ ret = change_vreses(fcb, schedulable_contracts);
+ if (ret) {
+ ul_logmsg("change_vreses bad return value: %d\n", ret);
+ goto error;
+ }
+error:
+ return;
+
}
CORBA_long register_resource(fres_contract_broker obj,