From: Adrien Lebre Date: Wed, 8 Apr 2015 09:24:38 +0000 (+0200) Subject: Add hosts test before migrating a VM - adrien X-Git-Tag: v3_12~739 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/7018d53f4b991df9ddfa5b0c53293118d200efd6 Add hosts test before migrating a VM - adrien --- diff --git a/src/bindings/java/org/simgrid/msg/VM.java b/src/bindings/java/org/simgrid/msg/VM.java index b858c49694..ac8a512561 100644 --- a/src/bindings/java/org/simgrid/msg/VM.java +++ b/src/bindings/java/org/simgrid/msg/VM.java @@ -158,7 +158,7 @@ public class VM extends Host{ try { this.internalmig(destination); } catch (Exception e){ - Msg.info("an exception occurs during the migration of VM "+this.getName()); + Msg.info("Migration of VM "+this.getName()+" to "+destination.getName()+" is impossible ("+e.getMessage()+")"); throw new HostFailureException(); } // If the migration correcly returned, then we should change the currentHost value. diff --git a/src/msg/msg_vm.c b/src/msg/msg_vm.c index 4d83a7d308..9bc7ab0c84 100644 --- a/src/msg/msg_vm.c +++ b/src/msg/msg_vm.c @@ -975,6 +975,12 @@ void MSG_vm_migrate(msg_vm_t vm, msg_host_t new_pm) msg_host_t old_pm = simcall_vm_get_pm(vm); + if(!MSG_host_is_off(old_pm)) + THROWF(vm_error, 0, "SRC host(%s) seems off, cannot start a migration", sg_host_name(old_pm)); + + if(!MSG_host_is_off(new_pm)) + THROWF(vm_error, 0, "DST host(%s) seems off, cannot start a migration", sg_host_name(new_pm)); + if (!MSG_vm_is_running(vm)) THROWF(vm_error, 0, "VM(%s) is not running", sg_host_name(vm));