From 409ea88a6680859992a30f3cc8c810d65e817ef1 Mon Sep 17 00:00:00 2001 From: 3hhh Date: Wed, 15 Jul 2020 18:14:42 +0200 Subject: [PATCH] storage/callback: add the backend_class property This should be useful for devs to inspect the Callback* classes. --- qubes/storage/callback.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/qubes/storage/callback.py b/qubes/storage/callback.py index 862fb5e7..057656a6 100644 --- a/qubes/storage/callback.py +++ b/qubes/storage/callback.py @@ -338,6 +338,13 @@ class CallbackPool(qubes.storage.Pool): if line == 'SIGNAL_setup': raise UnhandledSignalException(self, line) + @property + def backend_class(self): + '''Class of the first non-CallbackPool backend Pool.''' + if isinstance(self._cb_impl, CallbackPool): + return self._cb_impl.backend_class + return self._cb_impl.__class__ + @property def config(self): return { @@ -468,6 +475,13 @@ class CallbackVolume(qubes.storage.Volume): vol_args = [self.name, self.vid, self.source, *cb_args] yield from self._cb_pool._callback(cb, cb_args=vol_args, **kwargs) # pylint: disable=protected-access + @property + def backend_class(self): + '''Class of the first non-CallbackVolume backend Volume.''' + if isinstance(self._cb_impl, CallbackVolume): + return self._cb_impl.backend_class + return self._cb_impl.__class__ + @asyncio.coroutine def create(self): yield from self._assert_initialized()