From 0ed272aba22041443953a820a97523260375ebc4 Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Tue, 24 Nov 2015 13:36:26 +0100 Subject: [PATCH] [surf] Move VMCreatedCallbacks outside of constructor --- src/surf/vm_hl13.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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); } /* -- 2.20.1