Skip to content

Commit 9af2c94

Browse files
committed
rename image_transfer disk_id to volume_id
1 parent 1d20ecc commit 9af2c94

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

api/src/main/java/org/apache/cloudstack/backup/ImageTransfer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public enum Phase {
4545

4646
Long getBackupId();
4747

48-
long getDiskId();
48+
long getVolumeId();
4949

5050
long getHostId();
5151

engine/schema/src/main/java/org/apache/cloudstack/backup/ImageTransferVO.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public class ImageTransferVO implements ImageTransfer {
4545
@Column(name = "backup_id")
4646
private Long backupId;
4747

48-
@Column(name = "disk_id")
49-
private long diskId;
48+
@Column(name = "volume_id")
49+
private long volumeId;
5050

5151
@Column(name = "host_id")
5252
private long hostId;
@@ -102,9 +102,9 @@ public class ImageTransferVO implements ImageTransfer {
102102
public ImageTransferVO() {
103103
}
104104

105-
private ImageTransferVO(String uuid, long diskId, long hostId, Phase phase, Direction direction, Long accountId, Long domainId, Long dataCenterId) {
105+
private ImageTransferVO(String uuid, long volumeId, long hostId, Phase phase, Direction direction, Long accountId, Long domainId, Long dataCenterId) {
106106
this.uuid = uuid;
107-
this.diskId = diskId;
107+
this.volumeId = volumeId;
108108
this.hostId = hostId;
109109
this.phase = phase;
110110
this.direction = direction;
@@ -114,15 +114,15 @@ private ImageTransferVO(String uuid, long diskId, long hostId, Phase phase, Dire
114114
this.created = new Date();
115115
}
116116

117-
public ImageTransferVO(String uuid, Long backupId, long diskId, long hostId, String socket, Phase phase, Direction direction, Long accountId, Long domainId, Long dataCenterId) {
118-
this(uuid, diskId, hostId, phase, direction, accountId, domainId, dataCenterId);
117+
public ImageTransferVO(String uuid, Long backupId, long volumeId, long hostId, String socket, Phase phase, Direction direction, Long accountId, Long domainId, Long dataCenterId) {
118+
this(uuid, volumeId, hostId, phase, direction, accountId, domainId, dataCenterId);
119119
this.backupId = backupId;
120120
this.socket = socket;
121121
this.backend = Backend.nbd;
122122
}
123123

124-
public ImageTransferVO(String uuid, long diskId, long hostId, String file, Phase phase, Direction direction, Long accountId, Long domainId, Long dataCenterId) {
125-
this(uuid, diskId, hostId, phase, direction, accountId, domainId, dataCenterId);
124+
public ImageTransferVO(String uuid, long volumeId, long hostId, String file, Phase phase, Direction direction, Long accountId, Long domainId, Long dataCenterId) {
125+
this(uuid, volumeId, hostId, phase, direction, accountId, domainId, dataCenterId);
126126
this.file = file;
127127
this.backend = Backend.file;
128128
}
@@ -147,12 +147,12 @@ public void setBackupId(long backupId) {
147147
}
148148

149149
@Override
150-
public long getDiskId() {
151-
return diskId;
150+
public long getVolumeId() {
151+
return volumeId;
152152
}
153153

154-
public void setDiskId(long diskId) {
155-
this.diskId = diskId;
154+
public void setVolumeId(long volumeId) {
155+
this.volumeId = volumeId;
156156
}
157157

158158
@Override

engine/schema/src/main/java/org/apache/cloudstack/backup/dao/ImageTransferDaoImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ protected void init() {
5454
uuidSearch.done();
5555

5656
volumeSearch = createSearchBuilder();
57-
volumeSearch.and("volumeId", volumeSearch.entity().getDiskId(), SearchCriteria.Op.EQ);
57+
volumeSearch.and("volumeId", volumeSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
5858
volumeSearch.done();
5959

6060
volumeUnfinishedSearch = createSearchBuilder();
61-
volumeUnfinishedSearch.and("volumeId", volumeUnfinishedSearch.entity().getDiskId(), SearchCriteria.Op.EQ);
61+
volumeUnfinishedSearch.and("volumeId", volumeUnfinishedSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
6262
volumeUnfinishedSearch.and("phase", volumeUnfinishedSearch.entity().getPhase(), SearchCriteria.Op.NEQ);
6363
volumeUnfinishedSearch.done();
6464

plugins/integrations/veeam-control-service/src/main/java/org/apache/cloudstack/veeam/api/converter/ImageTransferVOToImageTransferConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static ImageTransfer toImageTransfer(ImageTransferVO vo, final Function<L
6464
}
6565
}
6666
if (volumeResolver != null) {
67-
VolumeJoinVO volumeVo = volumeResolver.apply(vo.getDiskId());
67+
VolumeJoinVO volumeVo = volumeResolver.apply(vo.getVolumeId());
6868
if (volumeVo != null) {
6969
imageTransfer.setDisk(Ref.of(basePath + DisksRouteHandler.BASE_ROUTE + "/" + volumeVo.getUuid(), volumeVo.getUuid()));
7070
imageTransfer.setImage(Ref.of(null, volumeVo.getUuid()));

server/src/main/java/org/apache/cloudstack/backup/KVMBackupExportServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ private ImageTransferResponse toImageTransferResponse(ImageTransferVO imageTrans
871871
Backup backup = backupDao.findByIdIncludingRemoved(backupId);
872872
response.setBackupId(backup.getUuid());
873873
}
874-
Long volumeId = imageTransferVO.getDiskId();
874+
Long volumeId = imageTransferVO.getVolumeId();
875875
Volume volume = volumeDao.findByIdIncludingRemoved(volumeId);
876876
response.setDiskId(volume.getUuid());
877877
response.setTransferUrl(imageTransferVO.getTransferUrl());
@@ -970,7 +970,7 @@ private void pollImageTransferProgress() {
970970
Map<String, Long> volumeSizes = new HashMap<>();
971971

972972
for (ImageTransferVO transfer : hostTransfers) {
973-
VolumeVO volume = volumeDao.findById(transfer.getDiskId());
973+
VolumeVO volume = volumeDao.findById(transfer.getVolumeId());
974974
if (volume == null) {
975975
logger.warn("Volume not found for image transfer: {}", transfer.getUuid());
976976
imageTransferDao.remove(transfer.getId()); // ToDo: confirm if this enough?

0 commit comments

Comments
 (0)