DaanHoogland commented on code in PR #13061: URL: https://github.com/apache/cloudstack/pull/13061#discussion_r3719457061
########## plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/MultipathNVMeOFPool.java: ########## @@ -0,0 +1,157 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package com.cloud.hypervisor.kvm.storage; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.cloudstack.utils.qemu.QemuImg; +import org.apache.cloudstack.utils.qemu.QemuImg.PhysicalDiskFormat; +import org.joda.time.Duration; + +import com.cloud.agent.api.to.HostTO; +import com.cloud.hypervisor.kvm.resource.KVMHABase.HAStoragePool; +import com.cloud.storage.Storage; +import com.cloud.storage.Storage.ProvisioningType; + +/** + * KVMStoragePool for NVMe-over-Fabrics pools. Mirror of + * {@link MultipathSCSIPool} for adapters based on + * {@link MultipathNVMeOFAdapterBase}. Every data operation is delegated + * back to the adapter; the pool itself only tracks addressing/identity. + */ +public class MultipathNVMeOFPool implements KVMStoragePool { + private final String uuid; + private final String sourceHost; + private final int sourcePort; + private final String sourceDir; + private final Storage.StoragePoolType storagePoolType; + private final StorageAdaptor storageAdaptor; + private final Map<String, String> details; + private long capacity; + private long used; + private long available; + + public MultipathNVMeOFPool(String uuid, String host, int port, String path, + Storage.StoragePoolType poolType, Map<String, String> poolDetails, StorageAdaptor adaptor) { + this.uuid = uuid; + this.sourceHost = host; + this.sourcePort = port; + this.sourceDir = path; + this.storagePoolType = poolType; + this.storageAdaptor = adaptor; + this.details = poolDetails; + this.capacity = 0; + this.used = 0; + this.available = 0; + } + + public MultipathNVMeOFPool(String uuid, StorageAdaptor adaptor) { + this.uuid = uuid; + this.sourceHost = null; + this.sourcePort = -1; + this.sourceDir = null; + this.storagePoolType = Storage.StoragePoolType.NVMeTCP; + this.storageAdaptor = adaptor; + this.details = new HashMap<>(); + this.capacity = 0; + this.used = 0; + this.available = 0; + } + + @Override + public KVMPhysicalDisk createPhysicalDisk(String volumeUuid, ProvisioningType provisioningType, long size, byte[] passphrase) { + return null; + } + + @Override + public KVMPhysicalDisk createPhysicalDisk(String volumeUuid, PhysicalDiskFormat format, ProvisioningType provisioningType, long size, byte[] passphrase) { + return null; + } + Review Comment: no @genegr , it is fine. we push back on it a lot. I’ll stop running it for this PR. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
