storage/lvm: prefix VM LVM volumes with 'vm-'

This will allow filtering them out in udev rules - to not parse any of
it.

QubesOS/qubes-issues#2319
This commit is contained in:
Marek Marczykowski-Górecki 2017-06-07 01:21:51 +02:00
parent fd3f19d4a6
commit fd5386cd47
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -134,7 +134,7 @@ class ThinPool(qubes.storage.Pool):
assert self.name assert self.name
volume_config['vid'] = "{!s}/{!s}-{!s}".format( volume_config['vid'] = "{!s}/vm-{!s}-{!s}".format(
self.volume_group, vm_name, volume_config['name']) self.volume_group, vm_name, volume_config['name'])
volume_config['volume_group'] = self.volume_group volume_config['volume_group'] = self.volume_group
@ -180,7 +180,7 @@ class ThinPool(qubes.storage.Pool):
def rename(self, volume, old_name, new_name): def rename(self, volume, old_name, new_name):
''' Called when the domain changes its name ''' ''' Called when the domain changes its name '''
new_vid = "{!s}/{!s}-{!s}".format(self.volume_group, new_name, new_vid = "{!s}/vm-{!s}-{!s}".format(self.volume_group, new_name,
volume.name) volume.name)
if volume.save_on_stop: if volume.save_on_stop:
cmd = ['clone', volume.vid, new_vid] cmd = ['clone', volume.vid, new_vid]