intel / ledmon

Enclosure LED Utilities
GNU General Public License v2.0
72 stars 49 forks source link

Ledctl: add command to retrieve default controller #248

Closed ktanska closed 1 month ago

ktanska commented 3 months ago

Add new command to ledctl, which enables to print the default, preferred available controller for given device. Output from this can be helpful when user must specify controller in other ledctl commands. Add parameter tests for new command: --default-controller. Use new method to choose default controller for device. It is especially needed when VMD and NPEM are available on one platform. Skip IBPI test when drive is connected to different default controller, than used to test. Test multipath drives only with default controller connected.

ktanska commented 2 months ago

Sorry, I just realized that we have to cover this in unit library tests: https://github.com/intel/ledmon/blob/main/tests/lib_unit_test.c

I see that lib_unit_test script uses only slot feature. I've retested it and problem did not appear.

mtkaczyk commented 2 months ago

@peluse could you please look? Especially for wording, I'm not sure if "best" is the appropriate. maybe "default" would be better?

The feature is addressing is a scenario where multiple controllers are detected for one disk (NPEM, VMD). The routine proposed here allows user to query ledctl to return used controller by default (aka. best) , you don't have to determine it manually.