A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mv msg/msg.h simgrid/msg.h
[simgrid.git]
/
examples
/
msg
/
cloud
/
migrate_vm.c
diff --git
a/examples/msg/cloud/migrate_vm.c
b/examples/msg/cloud/migrate_vm.c
index
0ada43f
..
03a08be
100644
(file)
--- a/
examples/msg/cloud/migrate_vm.c
+++ b/
examples/msg/cloud/migrate_vm.c
@@
-1,10
+1,11
@@
-/* Copyright (c) 2007-2012. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2014. 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>
/* 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. */
#include "xbt/sysdep.h" /* calloc, printf */
/* Create a log channel to have nice outputs. */
@@
-14,7
+15,7
@@
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
"Messages specific for this msg example");
"Messages specific for this msg example");
-void vm_migrate(msg_vm_t vm, msg_host_t dst_pm)
+
static
void vm_migrate(msg_vm_t vm, msg_host_t dst_pm)
{
msg_host_t src_pm = MSG_vm_get_pm(vm);
double mig_sta = MSG_get_clock();
{
msg_host_t src_pm = MSG_vm_get_pm(vm);
double mig_sta = MSG_get_clock();
@@
-26,7
+27,7
@@
void vm_migrate(msg_vm_t vm, msg_host_t dst_pm)
mig_end - mig_sta);
}
mig_end - mig_sta);
}
-int migration_worker_main(int argc, char *argv[])
+
static
int migration_worker_main(int argc, char *argv[])
{
xbt_assert(argc == 3);
char *vm_name = argv[1];
{
xbt_assert(argc == 3);
char *vm_name = argv[1];
@@
-40,7
+41,7
@@
int migration_worker_main(int argc, char *argv[])
return 0;
}
return 0;
}
-void vm_migrate_async(msg_vm_t vm, msg_host_t dst_pm)
+
static
void vm_migrate_async(msg_vm_t vm, msg_host_t dst_pm)
{
const char *vm_name = MSG_vm_get_name(vm);
const char *dst_pm_name = MSG_host_get_name(dst_pm);
{
const char *vm_name = MSG_vm_get_name(vm);
const char *dst_pm_name = MSG_host_get_name(dst_pm);
@@
-56,7
+57,7
@@
void vm_migrate_async(msg_vm_t vm, msg_host_t dst_pm)
MSG_process_create_with_arguments(pr_name, migration_worker_main, NULL, host, 3, argv);
}
MSG_process_create_with_arguments(pr_name, migration_worker_main, NULL, host, 3, argv);
}
-int master_main(int argc, char *argv[])
+
static
int master_main(int argc, char *argv[])
{
xbt_dynar_t hosts_dynar = MSG_hosts_as_dynar();
msg_host_t pm0 = xbt_dynar_get_as(hosts_dynar, 0, msg_host_t);
{
xbt_dynar_t hosts_dynar = MSG_hosts_as_dynar();
msg_host_t pm0 = xbt_dynar_get_as(hosts_dynar, 0, msg_host_t);
@@
-73,7
+74,7
@@
int master_main(int argc, char *argv[])
MSG_host_set_params(vm0, ¶ms);
MSG_vm_start(vm0);
MSG_host_set_params(vm0, ¶ms);
MSG_vm_start(vm0);
- XBT_INFO("Test: Migrate a VM with %l
d
Mbytes RAM", params.ramsize / 1000 / 1000);
+ XBT_INFO("Test: Migrate a VM with %l
lu
Mbytes RAM", params.ramsize / 1000 / 1000);
vm_migrate(vm0, pm1);
MSG_vm_destroy(vm0);
vm_migrate(vm0, pm1);
MSG_vm_destroy(vm0);
@@
-85,7
+86,7
@@
int master_main(int argc, char *argv[])
MSG_host_set_params(vm0, ¶ms);
MSG_vm_start(vm0);
MSG_host_set_params(vm0, ¶ms);
MSG_vm_start(vm0);
- XBT_INFO("Test: Migrate a VM with %l
d
Mbytes RAM", params.ramsize / 1000 / 1000);
+ XBT_INFO("Test: Migrate a VM with %l
lu
Mbytes RAM", params.ramsize / 1000 / 1000);
vm_migrate(vm0, pm1);
MSG_vm_destroy(vm0);
vm_migrate(vm0, pm1);
MSG_vm_destroy(vm0);
@@
-132,7
+133,7
@@
int master_main(int argc, char *argv[])
return 0;
}
return 0;
}
-void launch_master(msg_host_t host)
+
static
void launch_master(msg_host_t host)
{
const char *pr_name = "master_";
char **argv = xbt_new(char *, 2);
{
const char *pr_name = "master_";
char **argv = xbt_new(char *, 2);