scripts/nvmf_perf: move get_nvme_devices to Kernel Target
This function is used only by this class, remove it from common module. Signed-off-by: Karol Latecki <karol.latecki@intel.com> Change-Id: I6cb01e68f0005ddc1604ff4014c6b346da3a970e Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14852 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Michal Berger <michal.berger@intel.com> Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
This commit is contained in:
parent
3a359b7923
commit
0b995d4aba
@ -23,14 +23,6 @@ def get_nvme_devices_bdf():
|
|||||||
return output
|
return output
|
||||||
|
|
||||||
|
|
||||||
def get_nvme_devices():
|
|
||||||
print("Getting kernel NVMe names")
|
|
||||||
output = check_output("lsblk -o NAME -nlp", shell=True).decode(encoding="utf-8")
|
|
||||||
output = [x for x in output.split("\n") if "nvme" in x]
|
|
||||||
print("Done getting kernel NVMe names")
|
|
||||||
return output
|
|
||||||
|
|
||||||
|
|
||||||
def read_json_stats(file):
|
def read_json_stats(file):
|
||||||
with open(file, "r") as json_data:
|
with open(file, "r") as json_data:
|
||||||
data = json.load(json_data)
|
data = json.load(json_data)
|
||||||
|
@ -862,6 +862,11 @@ class KernelTarget(Target):
|
|||||||
def stop(self):
|
def stop(self):
|
||||||
self.nvmet_command(self.nvmet_bin, "clear")
|
self.nvmet_command(self.nvmet_bin, "clear")
|
||||||
|
|
||||||
|
def get_nvme_devices(self):
|
||||||
|
output = self.exec_cmd(["lsblk", "-o", "NAME", "-nlpd"])
|
||||||
|
output = [x for x in output.split("\n") if "nvme" in x]
|
||||||
|
return output
|
||||||
|
|
||||||
def nvmet_command(self, nvmet_bin, command):
|
def nvmet_command(self, nvmet_bin, command):
|
||||||
return self.exec_cmd([nvmet_bin, *(command.split(" "))])
|
return self.exec_cmd([nvmet_bin, *(command.split(" "))])
|
||||||
|
|
||||||
@ -925,7 +930,7 @@ class KernelTarget(Target):
|
|||||||
nvme_list = ["/dev/nullb{}".format(x) for x in range(self.null_block)]
|
nvme_list = ["/dev/nullb{}".format(x) for x in range(self.null_block)]
|
||||||
else:
|
else:
|
||||||
self.log.info("Configuring with NVMe drives.")
|
self.log.info("Configuring with NVMe drives.")
|
||||||
nvme_list = get_nvme_devices()
|
nvme_list = self.get_nvme_devices()
|
||||||
|
|
||||||
self.kernel_tgt_gen_subsystem_conf(nvme_list)
|
self.kernel_tgt_gen_subsystem_conf(nvme_list)
|
||||||
self.subsys_no = len(nvme_list)
|
self.subsys_no = len(nvme_list)
|
||||||
|
Loading…
Reference in New Issue
Block a user