Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class CommitVolumeSnapshotOnHypervisorMsg extends NeedReplyMessage implem
private VolumeSnapshotInventory srcSnapshot;
private VolumeSnapshotInventory dstSnapshot;
private List<String> srcChildrenInstallPathInDb = new ArrayList<>();
private List<String> chainInstallPathInDb = new ArrayList<>();

@Override
public String getHostUuid() {
Expand Down Expand Up @@ -54,4 +55,12 @@ public List<String> getSrcChildrenInstallPathInDb() {
public void setSrcChildrenInstallPathInDb(List<String> srcChildrenInstallPathInDb) {
this.srcChildrenInstallPathInDb = srcChildrenInstallPathInDb;
}

public List<String> getChainInstallPathInDb() {
return chainInstallPathInDb;
}

public void setChainInstallPathInDb(List<String> chainInstallPathInDb) {
this.chainInstallPathInDb = chainInstallPathInDb;
}
}
8 changes: 8 additions & 0 deletions plugin/kvm/src/main/java/org/zstack/kvm/KVMAgentCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -3771,6 +3771,7 @@ public static class BlockCommitCmd extends AgentCommand implements HasThreadCont
private String top;
private String base;
private List<String> topChildrenInstallPathInDb = new ArrayList<>();
private List<String> chainInstallPathInDb = new ArrayList<>();

public String getVmUuid() {
return vmUuid;
Expand Down Expand Up @@ -3811,6 +3812,13 @@ public List<String> getTopChildrenInstallPathInDb() {
public void setTopChildrenInstallPathInDb(List<String> topChildrenInstallPathInDb) {
this.topChildrenInstallPathInDb = topChildrenInstallPathInDb;
}
public List<String> getChainInstallPathInDb() {
return chainInstallPathInDb;
}

public void setChainInstallPathInDb(List<String> chainInstallPathInDb) {
this.chainInstallPathInDb = chainInstallPathInDb;
}
}

public static class BlockCommitResponse extends AgentResponse {
Expand Down
1 change: 1 addition & 0 deletions plugin/kvm/src/main/java/org/zstack/kvm/KVMHost.java
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,7 @@ private void commitVolumeSnapshot(final CommitVolumeSnapshotOnHypervisorMsg msg,
cmd.setTop(msg.getSrcSnapshot().getPrimaryStorageInstallPath());
cmd.setBase(msg.getDstSnapshot().getPrimaryStorageInstallPath());
cmd.setTopChildrenInstallPathInDb(msg.getSrcChildrenInstallPathInDb());
cmd.setChainInstallPathInDb(msg.getChainInstallPathInDb());

FlowChain chain = FlowChainBuilder.newShareFlowChain();
chain.setName(String.format("block-commit-for-volume-%s", msg.getVolume().getUuid()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,7 @@ public void run(FlowTrigger trigger, Map data) {
cmsg.setSrcSnapshot(srcSnapshotInv);
cmsg.setDstSnapshot(dstSnapshotInv);
cmsg.setSrcChildrenInstallPathInDb(childrenInstallPath);
cmsg.setChainInstallPathInDb(volumeTree.getAliveChainSnapshotInstallPath());
bus.makeTargetServiceIdByResourceUuid(cmsg, HostConstant.SERVICE_ID, hostUuid);
bus.send(cmsg, new CloudBusCallBack(trigger) {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,10 @@ public List<String> getAliveChainSnapshotUuids() {
return aliveChain.stream().map(VolumeSnapshotInventory::getUuid).collect(Collectors.toList());
}

public List<String> getAliveChainSnapshotInstallPath() {
return aliveChain.stream().map(VolumeSnapshotInventory::getPrimaryStorageInstallPath).collect(Collectors.toList());
}

public DeleteVolumeSnapshotDirection resolveDirection(String targetSnapshotUuid, String childSnapshotUuid, String initialDirection,
boolean targetSnapshotIsLatest, VmInstanceState vmState) {
boolean online = (vmState == VmInstanceState.Running || vmState == VmInstanceState.Paused)
Expand Down