initial support for nvmeof

Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
Travis Glenn Hansen
2022-12-20 22:48:36 -07:00
parent c8b13450d2
commit 9d2943b62d
16 changed files with 1555 additions and 533 deletions
+17 -1
View File
@@ -504,7 +504,8 @@ class Filesystem {
* lsblk
* blkid
*/
const strategy = process.env.FILESYSTEM_TYPE_DETECTION_STRATEGY || "lsblk";
const strategy =
process.env.FILESYSTEM_TYPE_DETECTION_STRATEGY || "lsblk";
switch (strategy) {
// requires udev data to be present otherwise fstype property is always null but otherwise succeeds
@@ -547,6 +548,21 @@ class Filesystem {
return result && result.tran == "iscsi";
}
async deviceIsNVMEoF(device) {
const filesystem = this;
let result;
do {
if (result) {
device = `/dev/${result.pkname}`;
}
result = await filesystem.getBlockDevice(device);
} while (result.pkname);
// TODO: add further logic here to ensure the device is not a local pcie/etc device
return result && result.tran == "nvme";
}
async getBlockDeviceParent(device) {
const filesystem = this;
let result;