From: Gabriel Corona Date: Tue, 24 Nov 2015 12:36:26 +0000 (+0100) Subject: [surf] Move VMCreatedCallbacks outside of constructor X-Git-Tag: v3_13~1556 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/0ed272aba22041443953a820a97523260375ebc4?ds=inline [surf] Move VMCreatedCallbacks outside of constructor --- diff --git a/src/surf/vm_hl13.cpp b/src/surf/vm_hl13.cpp index d33a5cde2e..fc317ee75d 100644 --- a/src/surf/vm_hl13.cpp +++ b/src/surf/vm_hl13.cpp @@ -29,8 +29,11 @@ void VMHL13Model::updateActionsState(double /*now*/, double /*delta*/) {} /* ind means ''indirect'' that this is a reference on the whole dict_elm * structure (i.e not on the surf_resource_private infos) */ -VirtualMachine *VMHL13Model::createVM(const char *name, surf_resource_t host_PM) { - return new VMHL13(this, name, NULL, host_PM); +VirtualMachine *VMHL13Model::createVM(const char *name, surf_resource_t host_PM) +{ + VirtualMachine* vm = new VMHL13(this, name, NULL, host_PM); + surf_callback_emit(VMCreatedCallbacks, vm); + return vm; } static inline double get_solved_value(CpuAction *cpu_action) @@ -197,8 +200,6 @@ VMHL13::VMHL13(VMModel *model, const char* name, xbt_dict_t props, p_action = sub_cpu->execute(0); XBT_INFO("Create VM(%s)@PM(%s) with %ld mounted disks", name, sub_ws->getName(), xbt_dynar_length(p_storage)); - - surf_callback_emit(VMCreatedCallbacks, this); } /*