Skip to content

Commit

Permalink
Add admin.vm.volume.Clear call (QubesOS/qubes-issues#5946)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillyPillow committed Jul 13, 2020
1 parent ae39c75 commit 455542a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions qubesadmin/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ def import_data_with_size(self, stream, size):
'ImportWithSize', payload=size_line.encode(),
payload_stream=stream)

def clear_data(self):
''' Clear existing volume content. '''
self._qubesd_call('Clear')

def clone(self, source):
''' Clone data from sane volume of another VM.
Expand Down
3 changes: 1 addition & 2 deletions qubesadmin/tools/qvm_template_postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ def import_root_img(vm, source_dir):

def reset_private_img(vm):
'''Clear private volume'''
with open('/dev/null', 'rb') as null:
vm.volumes['private'].import_data(stream=null)
vm.volumes['private'].clear_data()


def import_appmenus(vm, source_dir):
Expand Down

0 comments on commit 455542a

Please sign in to comment.