Skip to content

python-libnvme: drop 1.x backward-compatibility shims#3205

Open
martin-belanger wants to merge 1 commit intolinux-nvme:masterfrom
martin-belanger:python-cleanup
Open

python-libnvme: drop 1.x backward-compatibility shims#3205
martin-belanger wants to merge 1 commit intolinux-nvme:masterfrom
martin-belanger:python-cleanup

Conversation

@martin-belanger
Copy link

@martin-belanger martin-belanger commented Mar 24, 2026

Remove the deprecated method wrappers discovery_ctrl_set() and persistent_set() on ctrl, and the module-level aliases NVME_LOG_LID_DISCOVER and root that existed for compatibility with libnvme 1.x code. Callers should use the property setters (ctrl.discovery_ctrl, ctrl.persistent) and the canonical names (NVME_LOG_LID_DISCOVERY, global_ctx) directly.

Add a new Python test module (test-objects.py) covering object creation and property access, iterator correctness, boolean flag get/set, and error handling for disconnected controllers, replacing the removed deprecation-warning tests.

The new tests allowed finding and fixing a pre-existing bug in nvme.i where a NULL returned by nvme_read_hostnqn() or nvme_read_hostid() was not being handled and would cause a crash.

Remove the deprecated method wrappers `discovery_ctrl_set()` and
`persistent_set()` on `ctrl`, and the module-level aliases
`NVME_LOG_LID_DISCOVER` and `root` that existed for compatibility
with libnvme 1.x code. Callers should use the property setters
(`ctrl.discovery_ctrl`, `ctrl.persistent`) and the canonical names
(`NVME_LOG_LID_DISCOVERY`, `global_ctx`) directly.

Add a new Python test module (test-objects.py) covering object
creation and property access, iterator correctness, boolean flag
get/set, and error handling for disconnected controllers, replacing
the removed deprecation-warning tests.

The new tests allowed finding and fixing a pre-existing bug in
nvme.i where a NULL returned by nvme_read_hostnqn() or
nvme_read_hostid() was not being handled and would cause a crash.

Signed-off-by: Martin Belanger <martin.belanger@dell.com>

cac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant