From 9d2ef05c5d0b57139d8405a2af947091f2c13942 Mon Sep 17 00:00:00 2001 From: Tony Asleson Date: Mon, 7 Oct 2019 16:57:05 -0500 Subject: [PATCH] lvmdbusd: Add cfg.vdo_support Will be used to add vdo interfaces on demand. --- daemons/lvmdbusd/cfg.py | 3 +++ daemons/lvmdbusd/main.py | 6 +++++- test/dbus/lvmdbustest.py | 2 +- test/dbus/testlib.py | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/daemons/lvmdbusd/cfg.py b/daemons/lvmdbusd/cfg.py index be497d0a3..13143eff1 100644 --- a/daemons/lvmdbusd/cfg.py +++ b/daemons/lvmdbusd/cfg.py @@ -79,6 +79,9 @@ hidden_lv = itertools.count() load = None event = None +# Boolean to denote if lvm supports VDO integration +vdo_support = False + # Global cached state db = None diff --git a/daemons/lvmdbusd/main.py b/daemons/lvmdbusd/main.py index 7f0a028c1..de384ce4c 100644 --- a/daemons/lvmdbusd/main.py +++ b/daemons/lvmdbusd/main.py @@ -29,7 +29,7 @@ from .utils import log_debug, log_error import argparse import os import sys -from .cmdhandler import LvmFlightRecorder +from .cmdhandler import LvmFlightRecorder, supports_vdo from .request import RequestEntry @@ -127,6 +127,10 @@ def main(): log_error("You cannot specify --lvmshell and --nojson") sys.exit(1) + # We will dynamically add interfaces which support vdo if it + # exists. + cfg.vdo_support = supports_vdo() + # List of threads that we start up thread_list = [] diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py index d703a0a16..1e4d40d80 100755 --- a/test/dbus/lvmdbustest.py +++ b/test/dbus/lvmdbustest.py @@ -114,7 +114,7 @@ def get_objects(): rc = { MANAGER_INT: [], PV_INT: [], VG_INT: [], LV_INT: [], THINPOOL_INT: [], JOB_INT: [], SNAPSHOT_INT: [], LV_COMMON_INT: [], - CACHE_POOL_INT: [], CACHE_LV_INT: []} + CACHE_POOL_INT: [], CACHE_LV_INT: [], VG_VDO_INT: []} object_manager_object = bus.get_object( BUS_NAME, "/com/redhat/lvmdbus1", introspect=False) diff --git a/test/dbus/testlib.py b/test/dbus/testlib.py index 08f612cde..872ed802f 100644 --- a/test/dbus/testlib.py +++ b/test/dbus/testlib.py @@ -24,6 +24,7 @@ MANAGER_INT = BASE_INTERFACE + '.Manager' MANAGER_OBJ = '/' + BASE_INTERFACE.replace('.', '/') + '/Manager' PV_INT = BASE_INTERFACE + ".Pv" VG_INT = BASE_INTERFACE + ".Vg" +VG_VDO_INT = BASE_INTERFACE + ".VgVdo" LV_INT = BASE_INTERFACE + ".Lv" THINPOOL_INT = BASE_INTERFACE + ".ThinPool" SNAPSHOT_INT = BASE_INTERFACE + ".Snapshot" -- 2.43.5