forked from zstackio/zstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<feature>[sriov]: feature-5.1.0-sriov-live-migration
DBImpact Resolves: ZSTAC-63816 Change-Id: I6265696663776d636a6464706c69616562767a78
- Loading branch information
pengchao.liu
committed
Apr 11, 2024
1 parent
8cd174b
commit fc4fd4b
Showing
24 changed files
with
323 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
compute/src/main/java/org/zstack/compute/vm/VmMigratePostCallExtensionFlow.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.zstack.compute.vm; | ||
|
||
import org.springframework.beans.factory.annotation.Autowire; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.annotation.Configurable; | ||
import org.zstack.core.componentloader.PluginRegistry; | ||
import org.zstack.header.core.Completion; | ||
import org.zstack.header.core.workflow.Flow; | ||
import org.zstack.header.core.workflow.FlowRollback; | ||
import org.zstack.header.core.workflow.FlowTrigger; | ||
import org.zstack.header.errorcode.ErrorCode; | ||
import org.zstack.header.host.HostInventory; | ||
import org.zstack.header.vm.VmInstanceConstant; | ||
import org.zstack.header.vm.VmInstanceSpec; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
*/ | ||
@Configurable(preConstruction = true, autowire = Autowire.BY_TYPE) | ||
public class VmMigratePostCallExtensionFlow implements Flow { | ||
@Autowired | ||
protected PluginRegistry pluginRgty; | ||
@Autowired | ||
private VmInstanceExtensionPointEmitter extEmitter; | ||
|
||
@Override | ||
public void run(FlowTrigger trigger, Map data) { | ||
final VmInstanceSpec spec = (VmInstanceSpec) data.get(VmInstanceConstant.Params.VmInstanceSpec.toString()); | ||
|
||
final HostInventory destHost = spec.getDestHost(); | ||
extEmitter.postMigrateVm(spec.getVmInventory(), destHost.getUuid(), new Completion(trigger) { | ||
@Override | ||
public void success() { | ||
trigger.next(); | ||
} | ||
|
||
@Override | ||
public void fail(ErrorCode errorCode) { | ||
trigger.fail(errorCode); | ||
} | ||
}); | ||
} | ||
|
||
@Override | ||
public void rollback(FlowRollback trigger, Map data) { | ||
trigger.rollback(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.