storage/lvm: fix importing different-sized volume from another pool

Fixes QubesOS/qubes-issues#3257
This commit is contained in:
Marek Marczykowski-Górecki 2017-11-05 18:02:13 +01:00
parent f3455b5d99
commit 439d9b87ff
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -358,6 +358,8 @@ class ThinVolume(qubes.storage.Volume):
cmd = ['clone', str(src_volume), str(self)]
qubes_lvm(cmd, self.log)
else:
if src_volume.size != self.size:
self.resize(src_volume.size)
src_path = src_volume.export()
cmd = ['dd', 'if=' + src_path, 'of=/dev/' + self.vid,
'conv=sparse']