storage: add 'rw' and 'revision_to_keep' setters
QubesOS/qubes-issues#3256
This commit is contained in:
parent
b9b9eb1f3b
commit
b57b101b04
@ -142,6 +142,12 @@ class Volume(object):
|
|||||||
self._fetch_info()
|
self._fetch_info()
|
||||||
return self._info['rw'] == 'True'
|
return self._info['rw'] == 'True'
|
||||||
|
|
||||||
|
@rw.setter
|
||||||
|
def rw(self, value):
|
||||||
|
'''Set rw property'''
|
||||||
|
self._qubesd_call('Set.rw', str(value).encode('ascii'))
|
||||||
|
self._info = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def snap_on_start(self):
|
def snap_on_start(self):
|
||||||
'''Create a snapshot from source on VM start.'''
|
'''Create a snapshot from source on VM start.'''
|
||||||
@ -171,6 +177,12 @@ class Volume(object):
|
|||||||
self._fetch_info()
|
self._fetch_info()
|
||||||
return int(self._info['revisions_to_keep'])
|
return int(self._info['revisions_to_keep'])
|
||||||
|
|
||||||
|
@revisions_to_keep.setter
|
||||||
|
def revisions_to_keep(self, value):
|
||||||
|
'''Set revisions_to_keep property'''
|
||||||
|
self._qubesd_call('Set.revisions_to_keep', str(value).encode('ascii'))
|
||||||
|
self._info = None
|
||||||
|
|
||||||
def is_outdated(self):
|
def is_outdated(self):
|
||||||
''' Returns `True` if this snapshot of a source volume (for
|
''' Returns `True` if this snapshot of a source volume (for
|
||||||
`snap_on_start`=True) is outdated.
|
`snap_on_start`=True) is outdated.
|
||||||
@ -286,6 +298,20 @@ class Pool(object):
|
|||||||
''' Storage pool driver '''
|
''' Storage pool driver '''
|
||||||
return self.config['driver']
|
return self.config['driver']
|
||||||
|
|
||||||
|
@property
|
||||||
|
def revisions_to_keep(self):
|
||||||
|
'''Number of revisions to keep around'''
|
||||||
|
return int(self.config['revisions_to_keep'])
|
||||||
|
|
||||||
|
@revisions_to_keep.setter
|
||||||
|
def revisions_to_keep(self, value):
|
||||||
|
'''Set revisions_to_keep property'''
|
||||||
|
self.app.qubesd_call('dom0',
|
||||||
|
'admin.pool.Set.revisions_to_keep',
|
||||||
|
self.name,
|
||||||
|
str(value).encode('ascii'))
|
||||||
|
self._config = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def volumes(self):
|
def volumes(self):
|
||||||
''' Volumes managed by this pool '''
|
''' Volumes managed by this pool '''
|
||||||
|
Loading…
Reference in New Issue
Block a user