[Libguestfs] [PATCH] inspect: Ignore missing HKLM\SYSTEM\MountedDevices (RHBZ#803664).

Richard W.M. Jones rjones at redhat.com
Thu Mar 15 13:56:25 UTC 2012


From: "Richard W.M. Jones" <rjones at redhat.com>

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 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/inspect_fs_windows.c b/src/inspect_fs_windows.c
index 11454df..1a34192 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" };
-- 
1.7.9.1




More information about the Libguestfs mailing list