Skip to content

Commit dbf676b

Browse files
FelipeM525dhslove
authored andcommitted
engine/schema: Add access modifier to VolumeVO (apache#9394)
* added private access modifiers to VolumeVO and fixed an occurrence where a field was being accessed without a getter * renamed the field hostip to hostIp and removed duplicated methods apache#9394 (comment)
1 parent 9225e0f commit dbf676b

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

engine/schema/src/main/java/com/cloud/storage/VolumeVO.java

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -48,34 +48,34 @@ public class VolumeVO implements Volume {
4848
@TableGenerator(name = "volume_sq", table = "sequence", pkColumnName = "name", valueColumnName = "value", pkColumnValue = "volume_seq", allocationSize = 1)
4949
@GeneratedValue(strategy = GenerationType.TABLE)
5050
@Column(name = "id")
51-
long id;
51+
private long id;
5252

5353
@Column(name = "last_id")
5454
private long lastId;
5555

5656
@Column(name = "name")
57-
String name;
57+
private String name;
5858

5959
@Column(name = "pool_id")
60-
Long poolId;
60+
private Long poolId;
6161

6262
@Column(name = "last_pool_id")
63-
Long lastPoolId;
63+
private Long lastPoolId;
6464

6565
@Column(name = "account_id")
66-
long accountId;
66+
private long accountId;
6767

6868
@Column(name = "domain_id")
69-
long domainId;
69+
private long domainId;
7070

7171
@Column(name = "instance_id")
72-
Long instanceId = null;
72+
private Long instanceId = null;
7373

7474
@Column(name = "device_id")
75-
Long deviceId = null;
75+
private Long deviceId = null;
7676

7777
@Column(name = "size")
78-
Long size;
78+
private Long size;
7979

8080
@Column(name = "min_iops")
8181
private Long minIops;
@@ -84,50 +84,50 @@ public class VolumeVO implements Volume {
8484
private Long maxIops;
8585

8686
@Column(name = "folder")
87-
String folder;
87+
private String folder;
8888

8989
@Column(name = "path")
90-
String path;
90+
private String path;
9191

9292
@Column(name = "pod_id")
93-
Long podId;
93+
private Long podId;
9494

9595
@Column(name = "created")
96-
Date created;
96+
private Date created;
9797

9898
@Column(name = "attached")
9999
@Temporal(value = TemporalType.TIMESTAMP)
100-
Date attached;
100+
private Date attached;
101101

102102
@Column(name = "data_center_id")
103-
long dataCenterId;
103+
private long dataCenterId;
104104

105105
@Column(name = "host_ip")
106-
String hostip;
106+
private String hostIp;
107107

108108
@Column(name = "disk_offering_id")
109-
long diskOfferingId;
109+
private long diskOfferingId;
110110

111111
@Column(name = "template_id")
112-
Long templateId;
112+
private Long templateId;
113113

114114
@Column(name = "first_snapshot_backup_uuid")
115-
String firstSnapshotBackupUuid;
115+
private String firstSnapshotBackupUuid;
116116

117117
@Column(name = "volume_type")
118118
@Enumerated(EnumType.STRING)
119-
Type volumeType = Volume.Type.UNKNOWN;
119+
private Type volumeType = Volume.Type.UNKNOWN;
120120

121121
@Column(name = "pool_type")
122122
@Convert(converter = StoragePoolTypeConverter.class)
123-
StoragePoolType poolType;
123+
private StoragePoolType poolType;
124124

125125
@Column(name = GenericDao.REMOVED_COLUMN)
126-
Date removed;
126+
private Date removed;
127127

128128
@Column(name = "updated")
129129
@Temporal(value = TemporalType.TIMESTAMP)
130-
Date updated;
130+
private Date updated;
131131

132132
@Column(name = "update_count", updatable = true, nullable = false)
133133
protected long updatedCount; // This field should be updated everytime the
@@ -136,17 +136,17 @@ public class VolumeVO implements Volume {
136136
// dao code.
137137

138138
@Column(name = "recreatable")
139-
boolean recreatable;
139+
private boolean recreatable;
140140

141141
@Column(name = "state")
142142
@Enumerated(value = EnumType.STRING)
143143
private State state;
144144

145145
@Column(name = "chain_info", length = 65535)
146-
String chainInfo;
146+
private String chainInfo;
147147

148148
@Column(name = "uuid")
149-
String uuid;
149+
private String uuid;
150150

151151
@Column(name = "format")
152152
private Storage.ImageFormat format;
@@ -171,7 +171,7 @@ public class VolumeVO implements Volume {
171171

172172
@Transient
173173
// @Column(name="reservation")
174-
String reservationId;
174+
private String reservationId;
175175

176176
@Column(name = "hv_ss_reserve")
177177
private Integer hypervisorSnapshotReserve;
@@ -431,11 +431,11 @@ public void setPath(String path) {
431431
}
432432

433433
public String getHostIp() {
434-
return hostip;
434+
return hostIp;
435435
}
436436

437437
public void setHostIp(String hostip) {
438-
this.hostip = hostip;
438+
this.hostIp = hostip;
439439
}
440440

441441
public void setPodId(Long podId) {

server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3434,7 +3434,7 @@ public Volume migrateVolume(MigrateVolumeCmd cmd) {
34343434
}
34353435
// In case of VMware, if ROOT volume is being cold-migrated, then ensure destination storage pool is in the same Datacenter as the VM.
34363436
if (vm != null && vm.getHypervisorType().equals(HypervisorType.VMware)) {
3437-
if (!liveMigrateVolume && vol.volumeType.equals(Volume.Type.ROOT)) {
3437+
if (!liveMigrateVolume && vol.getVolumeType().equals(Volume.Type.ROOT)) {
34383438
Long hostId = vm.getHostId() != null ? vm.getHostId() : vm.getLastHostId();
34393439
HostVO host = _hostDao.findById(hostId);
34403440
if (host != null) {

0 commit comments

Comments
 (0)