Add admin.vm.volume.Clear call (QubesOS/qubes-issues#5946)
This commit is contained in:
parent
ae39c75867
commit
455542ac7f
@ -236,6 +236,10 @@ class Volume(object):
|
|||||||
'ImportWithSize', payload=size_line.encode(),
|
'ImportWithSize', payload=size_line.encode(),
|
||||||
payload_stream=stream)
|
payload_stream=stream)
|
||||||
|
|
||||||
|
def clear_data(self):
|
||||||
|
''' Clear existing volume content. '''
|
||||||
|
self._qubesd_call('Clear')
|
||||||
|
|
||||||
def clone(self, source):
|
def clone(self, source):
|
||||||
''' Clone data from sane volume of another VM.
|
''' Clone data from sane volume of another VM.
|
||||||
|
|
||||||
|
@ -124,8 +124,7 @@ def import_root_img(vm, source_dir):
|
|||||||
|
|
||||||
def reset_private_img(vm):
|
def reset_private_img(vm):
|
||||||
'''Clear private volume'''
|
'''Clear private volume'''
|
||||||
with open('/dev/null', 'rb') as null:
|
vm.volumes['private'].clear_data()
|
||||||
vm.volumes['private'].import_data(stream=null)
|
|
||||||
|
|
||||||
|
|
||||||
def import_appmenus(vm, source_dir):
|
def import_appmenus(vm, source_dir):
|
||||||
|
Loading…
Reference in New Issue
Block a user