Skip to content

Commit a06f8a8

Browse files
authored
Fixup updateSnapshotInfo failure due to forward merging (#8150)
Fixes build failures
1 parent 587d1d7 commit a06f8a8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ private void updateSnapshotInfo(Long volumeId, Long vmSnapshotId, VMSnapshotVO v
570570
if ((storagePool.getPoolType() == StoragePoolType.NetworkFilesystem || storagePool.getPoolType() == StoragePoolType.Filesystem) && vmSnapshot.getType() == VMSnapshot.Type.Disk) {
571571
List<VMSnapshotDetailsVO> vmSnapshotDetails = vmSnapshotDetailsDao.findDetails(vmSnapshotId, "kvmStorageSnapshot");
572572
for (VMSnapshotDetailsVO vmSnapshotDetailsVO : vmSnapshotDetails) {
573-
SnapshotInfo sInfo = snapshotDataFactory.getSnapshot(Long.parseLong(vmSnapshotDetailsVO.getValue()), DataStoreRole.Primary);
573+
SnapshotInfo sInfo = snapshotDataFactory.getSnapshot(Long.parseLong(vmSnapshotDetailsVO.getValue()), storagePool.getId(), DataStoreRole.Primary);
574574
if (sInfo.getVolumeId() == volumeId) {
575575
snapshotOnPrimaryStore.setState(ObjectInDataStoreStateMachine.State.Ready);
576576
snapshotOnPrimaryStore.setInstallPath(sInfo.getPath());

server/src/test/java/com/cloud/storage/snapshot/SnapshotManagerImplTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public class SnapshotManagerImplTest {
7474
@Mock
7575
SnapshotService snapshotService;
7676
@Mock
77-
SnapshotDataFactory snapshotDataFactory;
77+
SnapshotDataFactory snapshotFactory;
7878
@Mock
7979
ResourceLimitService resourceLimitService;
8080
@Mock
@@ -269,7 +269,7 @@ public void testCopyNewSnapshotToZones() {
269269
Mockito.when(store.getId()).thenReturn(storeId);
270270
Mockito.when(dataStoreManager.getDataStore(storeId, DataStoreRole.Image)).thenReturn(store);
271271
Mockito.when(snapshotStoreDao.listReadyBySnapshot(snapshotId, DataStoreRole.Image)).thenReturn(snapshotStoreList);
272-
Mockito.when(snapshotDataFactory.getSnapshot(Mockito.anyLong(), Mockito.any())).thenReturn(Mockito.mock(SnapshotInfo.class));
272+
Mockito.when(snapshotFactory.getSnapshot(Mockito.anyLong(), Mockito.any())).thenReturn(Mockito.mock(SnapshotInfo.class));
273273
CreateCmdResult result = Mockito.mock(CreateCmdResult.class);
274274
Mockito.when(result.isFailed()).thenReturn(false);
275275
Mockito.when(result.getPath()).thenReturn("SOMEPATH");

0 commit comments

Comments
 (0)