Skip to content
Snippets Groups Projects
Commit aca3e650 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Raise FatalError for guestfs < 1.17.18 in windows

If the media is windows and guestfs version is less than 1.17.18
raise a Fatal Error. The versions below this have a bug and
inspect_os will fail if the HKLM\SYSTEM\MountedDevices registry key
is missing. This key gets deleted by Microsoft Sysprep
parent bbfcaef1
No related branches found
No related tags found
No related merge requests found
...@@ -116,6 +116,16 @@ class Windows(OSBase): ...@@ -116,6 +116,16 @@ class Windows(OSBase):
def __init__(self, image, **kargs): def __init__(self, image, **kargs):
super(Windows, self).__init__(image, **kargs) super(Windows, self).__init__(image, **kargs)
# This commit was added in libguestfs 1.17.18 and is critical because
# Microsoft Sysprep removes this key:
#
# When a Windows guest doesn't have a HKLM\SYSTEM\MountedDevices node,
# inspection fails. However inspection should not completely fail just
# because we cannot get the drive letter mapping from a guest.
if check_guestfs_version(self.image.g, 1, 17, 18) < 0:
raise FatalError(
'For windows support libguestfs 1.17.17 or above is needed')
device = self.image.g.part_to_dev(self.root) device = self.image.g.part_to_dev(self.root)
self.last_part_num = self.image.g.part_list(device)[-1]['part_num'] self.last_part_num = self.image.g.part_list(device)[-1]['part_num']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment