From a43c351ca0a3457deed0e0217ad73d147e97f388 Mon Sep 17 00:00:00 2001 From: Martin Belanger Date: Thu, 6 Nov 2025 13:53:24 -0500 Subject: [PATCH] python bindings: add some definitions for backward compatibility libvnme 3.x changes a few definitions compared to 1.x. This adds backward compatible definitions. Signed-off-by: Martin Belanger --- libnvme/libnvme/nvme.i | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libnvme/libnvme/nvme.i b/libnvme/libnvme/nvme.i index b39ccff63d..2f2d3a6e14 100644 --- a/libnvme/libnvme/nvme.i +++ b/libnvme/libnvme/nvme.i @@ -1268,3 +1268,12 @@ PyObject *nbft_get(const char * filename); %rename($ignore, %$isvariable) ""; // ignore all variables %include "../src/nvme/types.h" + + +%pythoncode %{ +# Definitions for backward compatibility between libnvme 1.x and 3.x (there is no 2.x) +# Some terms (class/variable names) were changed and this allows running older python +# code written for libnvme 1.x with libnvme 3.x (and possibly later). +NVME_LOG_LID_DISCOVER = _nvme.NVME_LOG_LID_DISCOVERY +root = global_ctx +%}