storage: drop functions not being part of the API

commit/recover/reset should really be handled in start/stop. Nothing
stops specific pool implementation to define such functions privately.

QubesOS/qubes-issues#2256
This commit is contained in:
Marek Marczykowski-Górecki 2017-07-01 21:20:35 +02:00
parent 820539e909
commit 5971873680
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -152,12 +152,6 @@ class Volume(object):
This can be implemented as a coroutine.''' This can be implemented as a coroutine.'''
raise self._not_implemented("remove") raise self._not_implemented("remove")
def commit(self):
''' Write the snapshot to disk
This can be implemented as a coroutine.'''
raise self._not_implemented("commit")
def export(self): def export(self):
''' Returns an object that can be `open()`. ''' ''' Returns an object that can be `open()`. '''
raise self._not_implemented("export") raise self._not_implemented("export")
@ -195,15 +189,6 @@ class Volume(object):
''' '''
raise self._not_implemented("is_outdated") raise self._not_implemented("is_outdated")
def recover(self):
''' Try to recover a :py:class:`Volume` or :py:class:`SnapVolume` '''
raise self._not_implemented("recover")
def reset(self):
''' Drop and recreate volume without copying it's content from source.
'''
raise self._not_implemented("reset")
def resize(self, size): def resize(self, size):
''' Expands volume, throws ''' Expands volume, throws
:py:class:`qubes.storage.StoragePoolException` if :py:class:`qubes.storage.StoragePoolException` if
@ -544,19 +529,6 @@ class Storage(object):
if futures: if futures:
yield from asyncio.wait(futures) yield from asyncio.wait(futures)
@asyncio.coroutine
def commit(self):
''' Makes changes to an 'origin' volume persistent '''
futures = []
for volume in self.vm.volumes.values():
if volume.save_on_stop:
ret = volume.commit()
if asyncio.iscoroutine(ret):
futures.append(ret)
if futures:
yield asyncio.wait(futures)
def unused_frontend(self): def unused_frontend(self):
''' Find an unused device name ''' ''' Find an unused device name '''
unused_frontends = self.AVAILABLE_FRONTENDS.difference( unused_frontends = self.AVAILABLE_FRONTENDS.difference(