Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
 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())
Ejemplo n.º 3
0
 def revert(self, revision=None):
     yield from self._assert_initialized()
     return (yield from coro_maybe(self._cb_impl.revert(revision=revision)))
Ejemplo n.º 4
0
 def verify(self):
     yield from self._assert_initialized()
     return (yield from coro_maybe(self._cb_impl.verify()))
Ejemplo n.º 5
0
 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
Ejemplo n.º 6
0
 def export(self):
     yield from self._assert_initialized()
     yield from self._callback('pre_volume_export')
     return (yield from coro_maybe(self._cb_impl.export()))
Ejemplo n.º 7
0
 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
Ejemplo n.º 8
0
 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)))
Ejemplo n.º 9
0
 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
Ejemplo n.º 10
0
 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
Ejemplo n.º 11
0
 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
Ejemplo n.º 12
0
 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()))
Ejemplo n.º 13
0
 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