summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-03-22 11:20:38 +0000
committerRichard W.M. Jones <rjones@redhat.com>2011-03-29 20:24:38 +0100
commit3e549d86689893b791d2e489bd5bbf2d79c65a59 (patch)
treecfabc60e2cf92a4484cd5e259197ac32bc8c9193
parente3bb27af94641d1bed26574724ce46df73d2340e (diff)
downloadlibguestfs-3e549d86689893b791d2e489bd5bbf2d79c65a59.tar.gz
libguestfs-3e549d86689893b791d2e489bd5bbf2d79c65a59.tar.xz
libguestfs-3e549d86689893b791d2e489bd5bbf2d79c65a59.zip
inspect: Don't fail for Windows guests with multiple disks (RHBZ#674130).
Cherry picked from commit d06fee159c14d4fe7654a02bae8849c4f82565f8 and backported to stable-1.8 branch.
-rw-r--r--src/guestfs-internal.h2
-rw-r--r--src/inspect.c15
2 files changed, 15 insertions, 2 deletions
diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h
index 8ee0508b..69f44360 100644
--- a/src/guestfs-internal.h
+++ b/src/guestfs-internal.h
@@ -155,6 +155,8 @@ enum inspect_fs_content {
FS_CONTENT_UNKNOWN = 0,
FS_CONTENT_LINUX_ROOT,
FS_CONTENT_WINDOWS_ROOT,
+ FS_CONTENT_WINDOWS_VOLUME_WITH_APPS,
+ FS_CONTENT_WINDOWS_VOLUME,
FS_CONTENT_LINUX_BOOT,
FS_CONTENT_LINUX_USR,
FS_CONTENT_LINUX_USR_LOCAL,
diff --git a/src/inspect.c b/src/inspect.c
index 09ef2b14..f3cc54ef 100644
--- a/src/inspect.c
+++ b/src/inspect.c
@@ -353,9 +353,13 @@ check_filesystem (guestfs_h *g, const char *device)
guestfs_is_dir (g, "/run") > 0 &&
guestfs_is_dir (g, "/spool") > 0)
fs->content = FS_CONTENT_LINUX_VAR;
- /* Windows root? */
+ /* Windows root?
+ * Note that if a Windows guest has multiple disks and applications
+ * are installed on those other disks, then those other disks will
+ * contain "/Program Files" and "/System Volume Information". Those
+ * would *not* be Windows root disks. (RHBZ#674130)
+ */
else if (is_file_nocase (g, "/AUTOEXEC.BAT") > 0 ||
- is_dir_nocase (g, "/Program Files") > 0 ||
is_dir_nocase (g, "/WINDOWS") > 0 ||
is_dir_nocase (g, "/WIN32") > 0 ||
is_dir_nocase (g, "/WINNT") > 0 ||
@@ -366,6 +370,13 @@ check_filesystem (guestfs_h *g, const char *device)
if (check_windows_root (g, fs) == -1)
return -1;
}
+ /* Windows volume with installed applications (but not root)? */
+ else if (is_dir_nocase (g, "/System Volume Information") > 0 &&
+ is_dir_nocase (g, "/Program Files") > 0)
+ fs->content = FS_CONTENT_WINDOWS_VOLUME_WITH_APPS;
+ /* Windows volume (but not root)? */
+ else if (is_dir_nocase (g, "/System Volume Information") > 0)
+ fs->content = FS_CONTENT_WINDOWS_VOLUME;
return 0;
}