Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
java: rename an internal method
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 21 Mar 2017 20:16:02 +0000 (21:16 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 22 Mar 2017 00:44:13 +0000 (01:44 +0100)
src/bindings/java/jmsg_vm.cpp
src/bindings/java/jmsg_vm.h
src/bindings/java/org/simgrid/msg/VM.java

index 616c054..7e58e6a 100644 (file)
@@ -101,7 +101,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_shutdown(JNIEnv *env, jobject jvm
   }
 }
 
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_internalmig(JNIEnv *env, jobject jvm, jobject jhost)
+JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_nativeMigration(JNIEnv* env, jobject jvm, jobject jhost)
 {
   msg_vm_t vm = jvm_get_native(env,jvm);
   msg_host_t host = jhost_get_native(env, jhost);
index bdc66ac..cb0dfdc 100644 (file)
@@ -48,7 +48,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_create(JNIEnv* env, jobject jvm,
                                                       jint jramsize, jint dprate, jint mig_netspeed);
 JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_nativeFinalize(JNIEnv *env, jobject jvm);
 JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_start(JNIEnv *env, jobject jvm);
-JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_internalmig(JNIEnv *env, jobject jvm, jobject jhost);
+JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_nativeMigration(JNIEnv* env, jobject jvm, jobject jhost);
 JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_suspend(JNIEnv *env, jobject jvm);
 JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_resume(JNIEnv *env, jobject jvm);
 JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_shutdown(JNIEnv *env, jobject jvm);
index f9c961c..867eed8 100644 (file)
@@ -51,7 +51,7 @@ public class VM extends Host {
                return null; 
        }
        
-       /** Kills all the actors running on that VM 
+       /** Shutdown and unref the VM. 
         * 
         * Actually, this strictly equivalent to shutdown().
         * In C and in libvirt, the destroy function also releases the memory associated to the VM, 
@@ -61,6 +61,7 @@ public class VM extends Host {
         */
        public void destroy() {
                shutdown();
+///            vms.remove(this);
        }
 
        /* Make sure that the GC also destroys the C object */
@@ -107,17 +108,15 @@ public class VM extends Host {
         */
        public native void shutdown();
 
-       /** Invoke native migration routine */
-       public native void internalmig(Host destination) throws Exception; // TODO add throws DoubleMigrationException (i.e. when you call migrate on a VM that is already migrating);
-
-
+       /** native migration routine */
+       private native void nativeMigration(Host destination) throws Exception;
 
        /** Change the host on which all processes are running
         * (pre-copy is implemented)
         */     
        public void migrate(Host destination) throws HostFailureException{
                try {
-                       this.internalmig(destination);
+                       this.nativeMigration(destination);
                } catch (Exception e){
                  Msg.info("Migration of VM "+this.getName()+" to "+destination.getName()+" is impossible ("+e.getMessage()+")");
                  throw new HostFailureException();