storage/file: create -cow.img only when needed
Do not create it at volume creation time. It it needed only when VM is running, so create it just before startup only. QubesOS/qubes-issues#2256
This commit is contained in:
parent
c5667791e8
commit
4208897146
@ -164,9 +164,6 @@ class FileVolume(qubes.storage.Volume):
|
||||
'Volume size must be > 0'
|
||||
if not self.snap_on_start:
|
||||
create_sparse_file(self.path, self.size)
|
||||
# path_cow not needed only in volatile volume
|
||||
if self.save_on_stop or self.snap_on_start:
|
||||
create_sparse_file(self.path_cow, self.size)
|
||||
|
||||
def remove(self):
|
||||
if not self.snap_on_start:
|
||||
|
@ -406,8 +406,7 @@ class TC_03_FilePool(qubes.tests.QubesTestCase):
|
||||
expected_private_path)
|
||||
|
||||
expected_rootcow_path = os.path.join(expected_vmdir, 'root-cow.img')
|
||||
self.assertEqualAndExists(vm.volumes['root'].path_cow,
|
||||
expected_rootcow_path)
|
||||
self.assertEqual(vm.volumes['root'].path_cow, expected_rootcow_path)
|
||||
|
||||
def assertEqualAndExists(self, result_path, expected_path):
|
||||
""" Check if the ``result_path``, matches ``expected_path`` and exists.
|
||||
|
Loading…
Reference in New Issue
Block a user