def import_volume(self, src_volume): yield from self._assert_initialized() yield from self._callback('pre_volume_import', cb_args=[src_volume.vid]) ret = yield from coro_maybe(self._cb_impl.import_volume(src_volume)) yield from self._callback('post_volume_import', cb_args=[src_volume.vid]) return ret
def _process_signals(self, out): '''Process any signals found inside a string. :param out: String to check for signals. Each signal must be on a dedicated line. They are executed in the order they are found. Callbacks are not triggered. ''' for line in out.splitlines(): if line == 'SIGNAL_setup': self._cb_log.info('callback driver processing SIGNAL_setup for %s', self._cb_conf_id) #NOTE: calling our own methods may lead to a deadlock / qubesd freeze due to `self._assert_initialized()` / `self._cb_init_lock` yield from coro_maybe(self._cb_impl.setup())
def revert(self, revision=None): yield from self._assert_initialized() return (yield from coro_maybe(self._cb_impl.revert(revision=revision)))
def verify(self): yield from self._assert_initialized() return (yield from coro_maybe(self._cb_impl.verify()))
def export_end(self, path): yield from self._assert_initialized() ret = yield from coro_maybe(self._cb_impl.export_end(path)) yield from self._callback('post_volume_export_end', cb_args=[path]) return ret
def export(self): yield from self._assert_initialized() yield from self._callback('pre_volume_export') return (yield from coro_maybe(self._cb_impl.export()))
def import_data_end(self, success): yield from self._assert_initialized() ret = yield from coro_maybe(self._cb_impl.import_data_end(success)) yield from self._callback('post_volume_import_data_end', cb_args=[success]) return ret
def import_data(self, size): yield from self._assert_initialized() yield from self._callback('pre_volume_import_data', cb_args=[size]) return (yield from coro_maybe(self._cb_impl.import_data(size)))
def stop(self): yield from self._assert_initialized() ret = yield from coro_maybe(self._cb_impl.stop()) yield from self._callback('post_volume_stop') return ret
def remove(self): yield from self._assert_initialized() ret = yield from coro_maybe(self._cb_impl.remove()) yield from self._callback('post_volume_remove') return ret
def create(self): yield from self._assert_initialized() yield from self._callback('pre_volume_create') ret = yield from coro_maybe(self._cb_impl.create()) yield from self._callback('post_volume_create') return ret
def setup(self): yield from self._assert_initialized(callback=False) #setup is assumed to include storage initialization yield from self._callback('pre_setup') return (yield from coro_maybe(self._cb_impl.setup()))
def destroy(self): yield from self._assert_initialized() ret = yield from coro_maybe(self._cb_impl.destroy()) yield from self._callback('post_destroy') return ret