Skip to content

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

Merged
igaw merged 1 commit intolinux-nvme:masterfrom
martin-belanger:python-cleanup
Mar 30, 2026
Merged

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

Conversation

@martin-belanger
Copy link
Copy Markdown

@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
@igaw igaw merged commit 9544fab into linux-nvme:master Mar 30, 2026
28 checks passed
@igaw
Copy link
Copy Markdown
Collaborator

igaw commented Mar 30, 2026

Thanks!

@martin-belanger martin-belanger deleted the python-cleanup branch April 7, 2026 10:31
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.

2 participants