Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sed -i -e 's/\t/ /g' [sources] Please people, stop using tabs
[simgrid.git] / examples / msg / cloud / migrate_vm.c
index 46a8725..3eaed07 100644 (file)
@@ -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 <stdio.h>
-#include "msg/msg.h"
+#include "simgrid/msg.h"
 #include "xbt/sysdep.h"         /* calloc, printf */
 
 /* Create a log channel to have nice outputs. */
@@ -22,8 +23,8 @@ static void vm_migrate(msg_vm_t vm, msg_host_t dst_pm)
   double mig_end = MSG_get_clock();
 
   XBT_INFO("%s migrated: %s->%s in %g s", MSG_vm_get_name(vm),
-                 MSG_host_get_name(src_pm), MSG_host_get_name(dst_pm),
-                 mig_end - mig_sta);
+      MSG_host_get_name(src_pm), MSG_host_get_name(dst_pm),
+      mig_end - mig_sta);
 }
 
 static int migration_worker_main(int argc, char *argv[])
@@ -32,8 +33,8 @@ static int migration_worker_main(int argc, char *argv[])
   char *vm_name = argv[1];
   char *dst_pm_name = argv[2];
 
-  msg_vm_t vm = MSG_get_host_by_name(vm_name);
-  msg_host_t dst_pm = MSG_get_host_by_name(dst_pm_name);
+  msg_vm_t vm = MSG_host_by_name(vm_name);
+  msg_host_t dst_pm = MSG_host_by_name(dst_pm_name);
 
   vm_migrate(vm, dst_pm);
 
@@ -63,7 +64,7 @@ static int master_main(int argc, char *argv[])
   msg_host_t pm1 = xbt_dynar_get_as(hosts_dynar, 1, msg_host_t);
   msg_host_t pm2 = xbt_dynar_get_as(hosts_dynar, 2, msg_host_t);
   msg_vm_t vm0, vm1;
-  s_ws_params_t params;
+  s_vm_params_t params;
   memset(&params, 0, sizeof(params));
 
 
@@ -73,7 +74,7 @@ static int master_main(int argc, char *argv[])
   MSG_host_set_params(vm0, &params);
   MSG_vm_start(vm0);
 
-  XBT_INFO("Test: Migrate a VM with %ld Mbytes RAM", params.ramsize / 1000 / 1000);
+  XBT_INFO("Test: Migrate a VM with %llu Mbytes RAM", params.ramsize / 1000 / 1000);
   vm_migrate(vm0, pm1);
 
   MSG_vm_destroy(vm0);
@@ -85,7 +86,7 @@ static int master_main(int argc, char *argv[])
   MSG_host_set_params(vm0, &params);
   MSG_vm_start(vm0);
 
-  XBT_INFO("Test: Migrate a VM with %ld Mbytes RAM", params.ramsize / 1000 / 1000);
+  XBT_INFO("Test: Migrate a VM with %llu Mbytes RAM", params.ramsize / 1000 / 1000);
   vm_migrate(vm0, pm1);
 
   MSG_vm_destroy(vm0);