From: Samuel Lepetit Date: Thu, 14 Jun 2012 15:37:13 +0000 (+0200) Subject: Bugfix in cloud API (again) X-Git-Tag: v3_8~598^2~5 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e13b181b4f46c066edec65fe8364b5479dc4f113?hp=89e9288d420d813507e1456acdef62615bf15075 Bugfix in cloud API (again) --- diff --git a/src/msg/msg_vm.c b/src/msg/msg_vm.c index 7469ef06a8..948c8dedc3 100644 --- a/src/msg/msg_vm.c +++ b/src/msg/msg_vm.c @@ -78,6 +78,8 @@ void MSG_vm_bind(msg_vm_t vm, m_process_t process) { } simdata->vm = vm; + XBT_DEBUG("binding Process %s to %p",MSG_process_get_name(process),vm); + xbt_dynar_push_as(vm->processes,m_process_t,process); } /** @brief Removes the given process from the given VM, and kill it @@ -150,7 +152,9 @@ void MSG_vm_resume(msg_vm_t vm) { void MSG_vm_shutdown(msg_vm_t vm) { unsigned int cpt; m_process_t process; - xbt_dynar_foreach(vm->processes,cpt,process) { + XBT_DEBUG("%d processes in the VM",xbt_dynar_length(vm->processes)); + while (xbt_dynar_length(vm->processes) > 0) { + process = xbt_dynar_get_as(vm->processes,0,m_process_t); MSG_process_kill(process); } }