Revision 675d9367 src/lcm/LifeCycleStates.cc

View differences:

src/lcm/LifeCycleStates.cc
514 514

  
515 515
        dm->trigger(DispatchManager::POWEROFF_SUCCESS,vid);
516 516
    }
517
    else if (vm->get_lcm_state() == VirtualMachine::SHUTDOWN_SAVE)
518
    {
519
        //----------------------------------------------------
520
        //            EPILOG_SHUTDOWN_SAVE STATE
521
        //----------------------------------------------------
522

  
523
        vm->set_state(VirtualMachine::EPILOG_SHUTDOWN_SAVE);
524

  
525
        vm->delete_snapshots();
526

  
527
        vmpool->update(vm);
528

  
529
        vm->set_epilog_stime(the_time);
530

  
531
        vm->set_running_etime(the_time);
532

  
533
        vm->set_reason(History::STOP_RESUME);
534

  
535
        vmpool->update_history(vm);
536

  
537
        vm->log("LCM", Log::INFO, "New VM state is EPILOG_SHUTDOWN_SAVE");
538

  
539
        //----------------------------------------------------
540

  
541
        tm->trigger(TransferManager::EPILOG_STOP,vid);
542
    }
517 543
    else
518 544
    {
519 545
        vm->log("LCM",Log::ERROR,"shutdown_success_action, VM in a wrong state");
......
540 566
    }
541 567

  
542 568
    if ( vm->get_lcm_state() == VirtualMachine::SHUTDOWN ||
543
         vm->get_lcm_state() == VirtualMachine::SHUTDOWN_POWEROFF )
569
         vm->get_lcm_state() == VirtualMachine::SHUTDOWN_POWEROFF ||
570
         vm->get_lcm_state() == VirtualMachine::SHUTDOWN_SAVE )
544 571
    {
545 572
        //----------------------------------------------------
546 573
        //    RUNNING STATE FROM SHUTDOWN
......
734 761
    {
735 762
        action = DispatchManager::STOP_SUCCESS;
736 763
    }
764
    else if ( state == VirtualMachine::EPILOG_SHUTDOWN_SAVE )
765
    {
766
        action = DispatchManager::SHUTDOWN_SAVE_SUCCESS;
767
    }
737 768
    else if ( state == VirtualMachine::EPILOG )
738 769
    {
739 770
        action = DispatchManager::DONE;
......
834 865
        dm->trigger(DispatchManager::RESUBMIT, vid);
835 866
    }
836 867
    else if ( vm->get_lcm_state() == VirtualMachine::EPILOG_STOP ||
868
              vm->get_lcm_state() == VirtualMachine::EPILOG_SHUTDOWN_SAVE ||
837 869
              vm->get_lcm_state() == VirtualMachine::EPILOG )
838 870
    {
839 871
        vm->set_epilog_etime(the_time);
......
893 925

  
894 926
        tm->trigger(TransferManager::EPILOG,vid);
895 927
    }
928
    else if (vm->get_lcm_state() == VirtualMachine::SHUTDOWN_SAVE)
929
    {
930
        //----------------------------------------------------
931
        //            EPILOG_SHUTDOWN_SAVE STATE
932
        //----------------------------------------------------
933

  
934
        vm->set_state(VirtualMachine::EPILOG_SHUTDOWN_SAVE);
935

  
936
        vm->delete_snapshots();
937

  
938
        vmpool->update(vm);
939

  
940
        vm->set_epilog_stime(the_time);
941

  
942
        vm->set_running_etime(the_time);
943

  
944
        vm->set_reason(History::STOP_RESUME);
945

  
946
        vmpool->update_history(vm);
947

  
948
        vm->log("LCM", Log::INFO, "New VM state is EPILOG_SHUTDOWN_SAVE");
949

  
950
        //----------------------------------------------------
951

  
952
        tm->trigger(TransferManager::EPILOG_STOP,vid);
953
    }
896 954
    else
897 955
    {
898 956
        vm->log("LCM",Log::ERROR,"cancel_success_action, VM in a wrong state");
......
918 976
        return;
919 977
    }
920 978

  
921
    if ( vm->get_lcm_state() == VirtualMachine::CANCEL )
979
    if ( vm->get_lcm_state() == VirtualMachine::CANCEL ||
980
         vm->get_lcm_state() == VirtualMachine::SHUTDOWN_SAVE )
922 981
    {
923 982
        //----------------------------------------------------
924 983
        //    RUNNING STATE FROM CANCEL

Also available in: Unified diff