Skip to content

Commit d30ca6e

Browse files
committed
small refactoring
1 parent 6bcb459 commit d30ca6e

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtCheckVMActivityOnStoragePoolCommandWrapper.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public Answer execute(final CheckVMActivityOnStoragePoolCommand command, final L
4747
final KVMStoragePoolManager storagePoolMgr = libvirtComputingResource.getStoragePoolMgr();
4848

4949
KVMStoragePool primaryPool = storagePoolMgr.getStoragePool(pool.getType(), pool.getUuid());
50-
primaryPool.setType(pool.getType());
5150

5251
if (primaryPool.isPoolSupportHA()) {
5352
final HAStoragePool nfspool = monitor.getStoragePool(pool.getUuid());

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStoragePool.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ default Long getUsedIops() {
9191

9292
public StoragePoolType getType();
9393

94-
default void setType(StoragePoolType type) {
95-
}
96-
9794
public boolean delete();
9895

9996
PhysicalDiskFormat getDefaultFormat();

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ public KVMStoragePool getStoragePool(StoragePoolType type, String uuid, boolean
289289

290290
if (pool instanceof LibvirtStoragePool) {
291291
addPoolDetails(uuid, (LibvirtStoragePool) pool);
292+
((LibvirtStoragePool) pool).setType(type);
292293
}
293294

294295
return pool;
@@ -390,7 +391,9 @@ public KVMStoragePool createStoragePool(String name, String host, int port, Stri
390391
private synchronized KVMStoragePool createStoragePool(String name, String host, int port, String path, String userInfo, StoragePoolType type, Map<String, String> details, boolean primaryStorage) {
391392
StorageAdaptor adaptor = getStorageAdaptor(type);
392393
KVMStoragePool pool = adaptor.createStoragePool(name, host, port, path, userInfo, type, details, primaryStorage);
393-
pool.setType(type);
394+
if (pool instanceof LibvirtStoragePool) {
395+
((LibvirtStoragePool) pool).setType(type);
396+
}
394397

395398
// LibvirtStorageAdaptor-specific statement
396399
if (pool.isPoolSupportHA() && primaryStorage) {

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ public Boolean vmActivityCheck(HAStoragePool pool, HostTO host, Duration activit
423423
}
424424
}
425425

426-
@Override
427426
public void setType(StoragePoolType type) {
428427
this.type = type;
429428
}

0 commit comments

Comments
 (0)