+
+ saveRequest.setStatus( false ) ;
+
+ /* Requesting the VM save */
+ if( saveVM() == 1 )
+ {
+ System.err.println( "Problem while saving. Exiting ..." ) ;
+ pingServer.stopPing() ;
+ emergencyStop() ;
+ System.exit( 1 ) ;
+ }
+ } else {
+ sendSaveOkVM() ;
+ }
+ } else if( line != null && line.equalsIgnoreCase( "quit" ) ) {
+ /** Computation is done, we can shutdown the VM **/
+
+ try {
+ Thread.sleep( 5000 ) ;
+ } catch( InterruptedException e ) {
+ e.printStackTrace() ;
+ }
+
+ /* Close streams */
+ reader.close() ; reader = null ;
+ socket.close() ; socket = null ;
+
+ stopVM( 0 ) ;
+
+ machine.setStatus( "connected" ) ;
+ try {
+ LocalHost.Instance().getServerStub().changeStatus(
+ LocalHost.Instance().getIP(), "connected" ) ;
+ } catch( RemoteException e ) {
+ System.err.println( "Unable to inform the server of the VM status!" ) ;
+ e.printStackTrace() ;