From 91cede3465cd2496a01a89d5c8815df7c326c2ec Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 15 Mar 2012 13:53:32 +0000 Subject: inspect: Ignore missing HKLM\SYSTEM\MountedDevices (RHBZ#803664). 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. --- src/inspect_fs_windows.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/inspect_fs_windows.c b/src/inspect_fs_windows.c index 11454dff..1a341927 100644 --- a/src/inspect_fs_windows.c +++ b/src/inspect_fs_windows.c @@ -395,10 +395,11 @@ check_windows_system_registry (guestfs_h *g, struct inspect_fs *fs) errno = 0; node = hivex_node_get_child (h, root, "MountedDevices"); if (node == 0) { - if (errno != 0) - perrorf (g, "hivex_node_get_child"); - else - error (g, "hivex: could not locate HKLM\\SYSTEM\\MountedDevices"); + if (errno == 0) + /* Not found: skip getting drive letter mappings (RHBZ#803664). */ + goto skip_drive_letter_mappings; + /* errno != 0, so it's some other error from hivex */ + perrorf (g, "hivex_node_get_child"); goto out; } @@ -453,6 +454,7 @@ check_windows_system_registry (guestfs_h *g, struct inspect_fs *fs) free (key); } + skip_drive_letter_mappings:; /* Get the hostname. */ const char *hivepath[] = { fs->windows_current_control_set, "Services", "Tcpip", "Parameters" }; -- cgit