package org.zstack.header.vm;

import org.zstack.header.allocator.AllocationScene;
import org.zstack.header.message.NeedReplyMessage;

import java.util.List;

/**
 */
@SkipVmTracer(replyClass = MigrateVmReply.class)
public class MigrateVmMsg extends NeedReplyMessage implements VmInstanceMessage, MigrateVmMessage {
    private String vmInstanceUuid;
    private String strategy;
    private List<String> avoidHostUuids;
    private AllocationScene allocationScene;
    private String targetHostUuid;

    @Override
    public AllocationScene getAllocationScene() {
        return allocationScene;
    }

    public void setAllocationScene(AllocationScene allocationScene) {
        this.allocationScene = allocationScene;
    }

    public List<String> getAvoidHostUuids() {
        return avoidHostUuids;
    }

    public void setAvoidHostUuids(List<String> avoidHostUuids) {
        this.avoidHostUuids = avoidHostUuids;
    }

    public String getVmInstanceUuid() {
        return vmInstanceUuid;
    }

    public void setVmInstanceUuid(String vmInstanceUuid) {
        this.vmInstanceUuid = vmInstanceUuid;
    }

    @Override
    public String getHostUuid() {
        return targetHostUuid;
    }

    @Override
    public boolean isMigrateFromDestination() {
        return false;
    }

    @Override
    public boolean isAllowUnknown() {
        return false;
    }

    @Override
    public String getStrategy() {
        return strategy;
    }

    public void setStrategy(String strategy) {
        this.strategy = strategy;
    }

    public String getTargetHostUuid() {
        return targetHostUuid;
    }

    public void setTargetHostUuid(String targetHostUuid) {
        this.targetHostUuid = targetHostUuid;
    }
}

@@ -493,16 +493,60 @@
 ostUuid;
+%0A    private boolean migrateFromDestination;
 %0A%0A    @O
@@ -1314,37 +1314,199 @@
 %0A        return 
-false
+migrateFromDestination;%0A    %7D%0A%0A    public void setMigrateFromDestination(boolean migrateFromDestination) %7B%0A        this.migrateFromDestination = migrateFromDestination
 ;%0A    %7D%0A%0A    @Ov

Add migrateFromDestination in MigrateVmMsg