Skip to content

Commit 96d98de

Browse files
committed
Merge remote-tracking branch 'origin/4.13'
2 parents 7f5096a + 8ac2501 commit 96d98de

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRevertSnapshotCommandWrapper.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,16 @@ public Answer execute(final RevertSnapshotCommand command, final LibvirtComputin
8686
rados.connect();
8787

8888
String[] rbdPoolAndVolumeAndSnapshot = snapshotRelPath.split("/");
89+
int snapshotIndex = rbdPoolAndVolumeAndSnapshot.length - 1;
90+
String rbdSnapshotId = rbdPoolAndVolumeAndSnapshot[snapshotIndex];
8991

9092
IoCTX io = rados.ioCtxCreate(primaryPool.getSourceDir());
9193
Rbd rbd = new Rbd(io);
92-
RbdImage image = rbd.open(rbdPoolAndVolumeAndSnapshot[1]);
9394

94-
s_logger.debug(String.format("Attempting to rollback RBD snapshot [name:%s], [pool:%s], [volumeid:%s], [snapshotid:%s]", snapshot.getName(),
95-
rbdPoolAndVolumeAndSnapshot[0], rbdPoolAndVolumeAndSnapshot[1], rbdPoolAndVolumeAndSnapshot[2]));
96-
image.snapRollBack(rbdPoolAndVolumeAndSnapshot[2]);
95+
s_logger.debug(String.format("Attempting to rollback RBD snapshot [name:%s], [volumeid:%s], [snapshotid:%s]", snapshot.getName(), volumePath, rbdSnapshotId));
96+
97+
RbdImage image = rbd.open(volumePath);
98+
image.snapRollBack(rbdSnapshotId);
9799

98100
rbd.close(image);
99101
rados.ioCtxDestroy(io);

systemvm/debian/opt/cloud/bin/cs/CsRoute.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def set_route(self, cmd, method="add"):
7979
found = False
8080
search = cmd
8181
if "throw" in search:
82-
search = "type " + search
82+
search = search.replace("throw", "")
8383
for i in CsHelper.execute("ip route show " + search):
8484
found = True
8585
if not found and method == "add":

0 commit comments

Comments
 (0)