qubes-lvm: drop unused lvm_image_changed function

It tries to parse (untrusted) volume content, so remove it to not use it
accidentally.

QubesOS/qubes-issues#2256
This commit is contained in:
Marek Marczykowski-Górecki 2016-08-18 11:43:01 +02:00
parent 06f46243ec
commit de5d420331
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -22,9 +22,7 @@
from __future__ import print_function
import datetime
import logging
import os
import subprocess
import sys
import time
@ -35,23 +33,6 @@ import qubes
log = logging.getLogger('qubes.storage.lvm')
def lvm_image_changed(vm):
''' Returns true if source image changed '''
# TODO: reimplement lvm_image_changed
vm_root = vm.root_img
tp_root = vm.template.root_img
if not os.path.exists(vm_root):
return False
cmd = 'date +"%%s" -d "' + \
'`sudo tune2fs %s -l|grep "Last write time"|cut -d":" -f2,3,4`"'
result1 = subprocess.check_output(cmd % vm_root, shell=True).strip()
result2 = subprocess.check_output(cmd % tp_root, shell=True).strip()
result1 = datetime.datetime.strptime(result1, '%c')
result2 = datetime.datetime.strptime(result2, '%c')
return result2 > result1
def pool_exists(args):
""" Check if given name is an lvm thin volume. """
# TODO Implement a faster and proper working version pool_exists