fcb_remember_schedulable_contracts(fcb, schedulable_contracts);
forb_sequence_free(schedulable_contracts, fres_contract_ptr_destroy);
}
+ /* TODO: After we distinguish between APP and a real
+ * allocator, allocate VRESes (and perform mode change) here.
+ * Only if the resource allocator is not known at this point,
+ * wait with allocation the same way as it is done now. For
+ * this we will need more information about allocators i.e.
+ * its type (centralized, distributed, in app, ...). Too
+ * compilcated ;-( */
ft = fcb_transaction_new(transaction->name);
if (!ft) {
fc = tran_contract_indx2item(ft, index);
if (!fc) GOTO(err, FRSH_ERR_TOO_LARGE);
+ /* TODO: If we allow migration of task between resources (due
+ * to spare capacity reallocation), the following check will
+ * need reworking/enhancing. */
+ if (fc->ra) GOTO(err, FRES_ERR_VRES_ALREADY_ALLOCATED);
+
if (!get_fc_res_key(fc, &key))
GOTO(err, FRSH_ERR_RESOURCE_ID_INVALID);
resource = fcb_resource_find(fcb, &key);
WVTEST_MAIN("transaction negotiation - remote part")
{
frsh_transaction_t t;
- frsh_vres_id_t vres;
+ frsh_vres_id_t vres1, vres2;
WVFRSH(frsh_init());
WVFRSH(fra_dummy_init_and_activate_id(1));
+ WVFRSH(fra_dummy_init_and_activate_id(2));
#if 0
WVFRSH(frsh_transaction_wait_for_name(&t, "test"));
- WVPASS(frsh_transaction_alloc_vres(&t, TEST_CONTRACT_2, &vres3) ==
- FRES_ERR_VRES_ALREADY_ALLOCATED);
- WVFRSH(frsh_transaction_alloc_vres(&t, TEST_CONTRACT_3, &vres3));
+#else
+ WVFRSH(frsh_transaction_init(&t, "test"));
#endif
+ WVPASS(frsh_transaction_alloc_vres(&t, TEST_CONTRACT_1, &vres1) ==
+ FRES_ERR_VRES_ALREADY_ALLOCATED);
+ WVFRSH(frsh_transaction_alloc_vres(&t, TEST_CONTRACT_2, &vres2));
frsh_destroy();
}