]> rtime.felk.cvut.cz Git - frescor/frsh.git/commitdiff
Fixed "allocation" of dummy VRESes
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 27 Oct 2009 09:05:24 +0000 (10:05 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 27 Oct 2009 09:05:24 +0000 (10:05 +0100)
Dummy VRESes was not represented in application in any way, so it was not
possible for an application to cancel the dummy VRES. This happened in
fwptester.

fres/cbroker/fcb.c
fres/resalloc/fra_generic.c

index b1340068ff44bd5e97484d01a420525fbc52c88d..e906ca742c8a59e510a69d1b9c63d35b77b2ceaf 100644 (file)
@@ -555,8 +555,7 @@ change_vreses(struct fcb *fcb, fres_contract_ptr_seq *schedulable_contracts)
                fc = fcb_contract_find(fcb, &sc->id);
                assert(fc != NULL);
 
-               if (true /* TODO: if the schedulable contract is changed */ &&
-                   fres_contract_get_type(&sc) != FRSH_CT_DUMMY) {
+               if (true /* TODO: if the schedulable contract is changed */) {
                        if (last_ra != fc->ra) {
                                if (vreses._length) {
                                        ret = fres_resource_allocator_change_vreses(last_ra->ra,
index 798afe57bbea8328f2dbbcd2042fae843764f3da..5e65a3411fe25c494a11b29565b824489419aaf1 100644 (file)
@@ -195,6 +195,7 @@ CORBA_long change_vreses(fres_resource_allocator obj,
        /* Apply the changes */
        if (alloc->apply_vres_changes) {
                /* Full interface */
+               /* FIXME: Do not call this hook for DUMMY contracts */
                ret = alloc->apply_vres_changes(vreses, len, alloc->priv);
                if (ret) {
                        ul_logerr("apply_vres_changes failed %d\n", ret);
@@ -204,6 +205,8 @@ CORBA_long change_vreses(fres_resource_allocator obj,
                /* Simple interface */
                for (i=0; i<len; i++) {
                        struct fres_vres *vres = vreses[i];
+                       if (fres_contract_get_type(&vres->new) == FRSH_CT_DUMMY)
+                               continue;
                        if (fres_contract_get_num_blocks(vres->new) == 0) {
                                /* VRES cancleation */
                                ret = alloc->cancel_vres(vres, alloc->priv);