bug 7237: disk size is passed in diskProfile, no need size parameter in createcommand

status 7237: rresolved fixed
This commit is contained in:
edison 2010-11-19 11:54:08 -08:00
parent e9145e4011
commit 0c35f2f743
3 changed files with 8 additions and 17 deletions

View File

@ -27,7 +27,6 @@ public class CreateCommand extends Command {
private StorageFilerTO pool;
private DiskProfile diskCharacteristics;
private String templateUrl;
private long size;
protected CreateCommand() {
super();
@ -43,7 +42,7 @@ public class CreateCommand extends Command {
* @param pool
*/
public CreateCommand(DiskProfile diskCharacteristics, String templateUrl, StorageFilerTO pool) {
this(diskCharacteristics, pool, 0);
this(diskCharacteristics, pool);
this.templateUrl = templateUrl;
}
@ -55,20 +54,19 @@ public class CreateCommand extends Command {
* @param diskCharacteristics
* @param pool
*/
public CreateCommand(DiskProfile diskCharacteristics, StorageFilerTO pool, long size) {
public CreateCommand(DiskProfile diskCharacteristics, StorageFilerTO pool) {
this.volId = diskCharacteristics.getVolumeId();
this.diskCharacteristics = diskCharacteristics;
this.pool = pool;
this.templateUrl = null;
this.size = size;
}
public CreateCommand(DiskProfile diskCharacteristics, String templateUrl, StoragePool pool) {
this(diskCharacteristics, templateUrl, new StorageFilerTO(pool));
}
public CreateCommand(DiskProfile diskCharacteristics, StoragePool pool, long size) {
this(diskCharacteristics, new StorageFilerTO(pool), size);
public CreateCommand(DiskProfile diskCharacteristics, StoragePool pool) {
this(diskCharacteristics, new StorageFilerTO(pool));
}
@Override
@ -92,10 +90,6 @@ public class CreateCommand extends Command {
return volId;
}
public long getSize(){
return this.size;
}
@Deprecated
public String getInstanceName() {
return null;

View File

@ -4695,11 +4695,8 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR
vdir.nameLabel = dskch.getName();
vdir.SR = poolSr;
vdir.type = Types.VdiType.USER;
if(cmd.getSize()!=0)
vdir.virtualSize = (cmd.getSize()*1024*1024*1L);
else
vdir.virtualSize = dskch.getSize();
vdir.virtualSize = dskch.getSize();
vdi = VDI.create(conn, vdir);
}

View File

@ -791,7 +791,7 @@ public class StorageManagerImpl implements StorageManager {
}
cmd = new CreateCommand(dskCh, tmpltStoredOn.getLocalDownloadPath(), new StorageFilerTO(pool));
} else {
cmd = new CreateCommand(dskCh, new StorageFilerTO(pool), size);
cmd = new CreateCommand(dskCh, new StorageFilerTO(pool));
}
Answer answer = sendToPool(pool, cmd);
@ -2813,7 +2813,7 @@ public class StorageManagerImpl implements StorageManager {
}
cmd = new CreateCommand(diskProfile, tmpltStoredOn.getLocalDownloadPath(), new StorageFilerTO(pool));
} else {
cmd = new CreateCommand(diskProfile, new StorageFilerTO(pool), diskProfile.getSize());
cmd = new CreateCommand(diskProfile, new StorageFilerTO(pool));
}
Answer answer = sendToPool(pool, cmd);
if (answer.getResult()) {