Skip to content

Commit 0c35f2f

Browse files
committed
bug 7237: disk size is passed in diskProfile, no need size parameter in createcommand
status 7237: rresolved fixed
1 parent e9145e4 commit 0c35f2f

3 files changed

Lines changed: 8 additions & 17 deletions

File tree

api/src/com/cloud/agent/api/storage/CreateCommand.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public class CreateCommand extends Command {
2727
private StorageFilerTO pool;
2828
private DiskProfile diskCharacteristics;
2929
private String templateUrl;
30-
private long size;
3130

3231
protected CreateCommand() {
3332
super();
@@ -43,7 +42,7 @@ protected CreateCommand() {
4342
* @param pool
4443
*/
4544
public CreateCommand(DiskProfile diskCharacteristics, String templateUrl, StorageFilerTO pool) {
46-
this(diskCharacteristics, pool, 0);
45+
this(diskCharacteristics, pool);
4746
this.templateUrl = templateUrl;
4847
}
4948

@@ -55,20 +54,19 @@ public CreateCommand(DiskProfile diskCharacteristics, String templateUrl, Storag
5554
* @param diskCharacteristics
5655
* @param pool
5756
*/
58-
public CreateCommand(DiskProfile diskCharacteristics, StorageFilerTO pool, long size) {
57+
public CreateCommand(DiskProfile diskCharacteristics, StorageFilerTO pool) {
5958
this.volId = diskCharacteristics.getVolumeId();
6059
this.diskCharacteristics = diskCharacteristics;
6160
this.pool = pool;
6261
this.templateUrl = null;
63-
this.size = size;
6462
}
6563

6664
public CreateCommand(DiskProfile diskCharacteristics, String templateUrl, StoragePool pool) {
6765
this(diskCharacteristics, templateUrl, new StorageFilerTO(pool));
6866
}
6967

70-
public CreateCommand(DiskProfile diskCharacteristics, StoragePool pool, long size) {
71-
this(diskCharacteristics, new StorageFilerTO(pool), size);
68+
public CreateCommand(DiskProfile diskCharacteristics, StoragePool pool) {
69+
this(diskCharacteristics, new StorageFilerTO(pool));
7270
}
7371

7472
@Override
@@ -92,10 +90,6 @@ public long getVolumeId() {
9290
return volId;
9391
}
9492

95-
public long getSize(){
96-
return this.size;
97-
}
98-
9993
@Deprecated
10094
public String getInstanceName() {
10195
return null;

core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4695,11 +4695,8 @@ public CreateAnswer execute(CreateCommand cmd) {
46954695
vdir.nameLabel = dskch.getName();
46964696
vdir.SR = poolSr;
46974697
vdir.type = Types.VdiType.USER;
4698-
4699-
if(cmd.getSize()!=0)
4700-
vdir.virtualSize = (cmd.getSize()*1024*1024*1L);
4701-
else
4702-
vdir.virtualSize = dskch.getSize();
4698+
4699+
vdir.virtualSize = dskch.getSize();
47034700
vdi = VDI.create(conn, vdir);
47044701
}
47054702

server/src/com/cloud/storage/StorageManagerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ public VolumeVO createVolume(VolumeVO volume, VMInstanceVO vm, VMTemplateVO temp
791791
}
792792
cmd = new CreateCommand(dskCh, tmpltStoredOn.getLocalDownloadPath(), new StorageFilerTO(pool));
793793
} else {
794-
cmd = new CreateCommand(dskCh, new StorageFilerTO(pool), size);
794+
cmd = new CreateCommand(dskCh, new StorageFilerTO(pool));
795795
}
796796

797797
Answer answer = sendToPool(pool, cmd);
@@ -2813,7 +2813,7 @@ public Pair<VolumeTO, StoragePool> createVolume(VolumeVO toBeCreated, DiskOfferi
28132813
}
28142814
cmd = new CreateCommand(diskProfile, tmpltStoredOn.getLocalDownloadPath(), new StorageFilerTO(pool));
28152815
} else {
2816-
cmd = new CreateCommand(diskProfile, new StorageFilerTO(pool), diskProfile.getSize());
2816+
cmd = new CreateCommand(diskProfile, new StorageFilerTO(pool));
28172817
}
28182818
Answer answer = sendToPool(pool, cmd);
28192819
if (answer.getResult()) {

0 commit comments

Comments
 (0)