X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/591d1f1de204ef7303e6d02c88ae4c7f59c564de..f1c440626e48ed8e544c438b6e0fcb178d654596:/src/bindings/java/jmsg_vm.cpp diff --git a/src/bindings/java/jmsg_vm.cpp b/src/bindings/java/jmsg_vm.cpp index 608d9f8248..063819d0af 100644 --- a/src/bindings/java/jmsg_vm.cpp +++ b/src/bindings/java/jmsg_vm.cpp @@ -6,6 +6,8 @@ /* 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 "jmsg.h" #include "jmsg_vm.h" #include "jmsg_host.h" @@ -100,7 +102,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_create(JNIEnv *env, jobject jvm, // disk_path = (*env)->GetStringUTFChars(env, jdiskpath, 0); // disk_path = xbt_strdup(disk_path); - msg_vm_t vm = MSG_vm_create(host, name, (int) jncore, (int) jramsize, (int) jnetcap, NULL, (int) jdisksize, + msg_vm_t vm = MSG_vm_create(host, name, (int) jncore, (int) jramsize, (int) jnetcap, nullptr, (int) jdisksize, (int) jmig_netspeed, (int) jdp_intensity); jvm_bind(env,jvm,vm); @@ -128,12 +130,11 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_internalmig(JNIEnv *env, jobject { msg_vm_t vm = jvm_get_native(env,jvm); msg_host_t host = jhost_get_native(env, jhost); - xbt_ex_t e; - TRY{ + try { MSG_vm_migrate(vm,host); - } CATCH(e){ - XBT_VERB("CATCH EXCEPTION MIGRATION %s",e.msg); - xbt_ex_free(e); + } + catch(xbt_ex& e){ + XBT_VERB("CATCH EXCEPTION MIGRATION %s",e.what()); jxbt_throw_host_failure(env, (char*)"during migration"); } }