Commit 0b995d4a authored by Karol Latecki's avatar Karol Latecki Committed by Tomasz Zawadzki
Browse files

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: default avatarKarol Latecki <karol.latecki@intel.com>
Change-Id: I6cb01e68f0005ddc1604ff4014c6b346da3a970e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14852


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
parent 3a359b79
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -23,14 +23,6 @@ def get_nvme_devices_bdf():
    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):
    with open(file, "r") as json_data:
        data = json.load(json_data)
+6 −1
Original line number Diff line number Diff line
@@ -862,6 +862,11 @@ class KernelTarget(Target):
    def stop(self):
        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):
        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)]
        else:
            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.subsys_no = len(nvme_list)