Revision f22ca784 src/dm/DispatchManagerActions.cc

View differences:

src/dm/DispatchManagerActions.cc
768 768
    string& error_str)
769 769
{
770 770
    VirtualMachine * vm;
771
    Host * host;
771 772
    ostringstream oss;
772 773

  
773 774
    VirtualMachine::VmState state;
775
    bool is_public_host;
774 776

  
775
    vm = vmpool->get(vid,true);
777
    vm   = vmpool->get(vid,true);
778

  
779
    host           = hpool->get(vm->get_hid(),true);
780
    is_public_host = host->is_public_cloud();
781
    host->unlock();
782
    
776 783

  
777 784
    if ( vm == 0 )
778 785
    {
......
793 800
            vm->get_requirements(cpu,mem,disk);
794 801
            hpool->del_capacity(vm->get_hid(), vm->get_oid(), cpu, mem, disk);
795 802

  
796
            tm->trigger(TransferManager::EPILOG_DELETE,vid);
803
            if (is_public_host)
804
            {
805
                vmm->trigger(VirtualMachineManager::CLEANUP,vid);
806
            }
807
            else
808
            {
809
                tm->trigger(TransferManager::EPILOG_DELETE,vid);
810
            }
811

  
797 812
            finalize_cleanup(vm);
798 813
        break;
799 814

  
800 815
        case VirtualMachine::STOPPED:
801 816
        case VirtualMachine::UNDEPLOYED:
802
            tm->trigger(TransferManager::EPILOG_DELETE_STOP,vid);
817
            if (is_public_host)
818
            {
819
                vmm->trigger(VirtualMachineManager::CLEANUP,vid);
820
            }
821
            else
822
            {
823
                tm->trigger(TransferManager::EPILOG_DELETE,vid);
824
            }
825

  
803 826
            finalize_cleanup(vm);
804 827
        break;
805 828

  

Also available in: Unified diff