X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/dd22867177c86db2e9d0b76852cb09e044b1c0c8..6a42d0b4d34e2b9777922430ef85646dabbefa20:/examples/msg/cloud/simple_vm.c diff --git a/examples/msg/cloud/simple_vm.c b/examples/msg/cloud/simple_vm.c index e61c01c93c..aac646c667 100644 --- a/examples/msg/cloud/simple_vm.c +++ b/examples/msg/cloud/simple_vm.c @@ -1,10 +1,11 @@ -/* Copyright (c) 2007-2012. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2015. The SimGrid Team. + * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ #include -#include "msg/msg.h" +#include "simgrid/msg.h" #include "xbt/sysdep.h" /* calloc, printf */ /* Create a log channel to have nice outputs. */ @@ -85,6 +86,7 @@ static int communication_rx_fun(int argc, char *argv[]) MSG_process_get_name(priv->tx_proc), host_name, pr_name, clock_end - priv->clock_sta); + xbt_free(priv); MSG_task_destroy(task); return 0; @@ -252,6 +254,12 @@ static int master_main(int argc, char *argv[]) XBT_INFO("## Test 6 (started): Check migration impact (not yet implemented neither on the CPU resource nor on the network one"); XBT_INFO("### Relocate VM0 between PM0 and PM1"); vm0 = MSG_vm_create_core(pm0, "VM0"); + { + s_vm_params_t params; + memset(¶ms, 0, sizeof(params)); + params.ramsize = 1L * 1024 * 1024 * 1024; // 1Gbytes + MSG_host_set_params(vm0, ¶ms); + } MSG_vm_start(vm0); launch_communication_worker(vm0, pm2); MSG_process_sleep(0.01); @@ -262,6 +270,7 @@ static int master_main(int argc, char *argv[]) MSG_vm_destroy(vm0); XBT_INFO("## Test 6 (ended)"); + xbt_dynar_free(&hosts_dynar); return 0; } @@ -291,7 +300,7 @@ int main(int argc, char *argv[]) int res = MSG_main(); XBT_INFO("Bye (simulation time %g)", MSG_get_clock()); - + xbt_dynar_free(&hosts_dynar); return !(res == MSG_OK); }