Skip to content

Commit cc755f5

Browse files
author
haidong.pang
committed
<fix>[vm_local_volume_cache]: Set CacheTO in extension point
Enable cache for an in-use volume omits some command fields sent to the agent. VmLocalVolumeCacheManagerImpl implements the convertVolumeIfNeed method of KVMConvertVolumeExtensionPoint. CacheTO should be set in the implementation of this extension point. Resolves: ZSTAC-83649 Change-Id: I69757864676978787767736a6f777a7562636b75
1 parent 62de5fa commit cc755f5

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

plugin/kvm/src/main/java/org/zstack/kvm/VolumeTO.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
import org.zstack.core.db.Q;
66
import org.zstack.header.host.HostInventory;
77
import org.zstack.header.image.ImagePlatform;
8-
import org.zstack.header.localVolumeCache.VmLocalVolumeCacheInventory;
9-
import org.zstack.header.localVolumeCache.VmLocalVolumeCacheVO;
10-
import org.zstack.header.localVolumeCache.VmLocalVolumeCacheVO_;
118
import org.zstack.header.storage.primary.PrimaryStorageVO;
129
import org.zstack.header.storage.primary.PrimaryStorageVO_;
1310
import org.zstack.header.vm.VmInstanceVO;
@@ -158,16 +155,7 @@ public static VolumeTO valueOf(VolumeInventory vol, KVMHostInventory host, Strin
158155
for (KVMConvertVolumeExtensionPoint ext : exts) {
159156
to = ext.convertVolumeIfNeed(host, vol, to);
160157
}
161-
VmLocalVolumeCacheVO cacheVO = Q.New(VmLocalVolumeCacheVO.class)
162-
.eq(VmLocalVolumeCacheVO_.volumeUuid, vol.getUuid())
163-
.find();
164-
if (cacheVO == null) {
165-
return to;
166-
}
167-
VmLocalVolumeCacheInventory cacheInv = VmLocalVolumeCacheInventory.valueOf(cacheVO);
168-
CacheTO cacheTO = CacheTO.valueOf(cacheInv);
169-
to.setCache(cacheTO);
170-
return to;
158+
return to;
171159
}
172160

173161
private synchronized static void prepareExts() {

0 commit comments

Comments
 (0)