[Libguestfs] [PATCH] inspect: Don't fail for Windows guests with multiple disks (RHBZ#674130).
Matthew Booth
mbooth at redhat.com
Tue Mar 22 16:16:18 UTC 2011
On 22/03/11 11:23, Richard W.M. Jones wrote:
>> From f7806322c5173d392e1f22b99ea00d45083f3f42 Mon Sep 17 00:00:00 2001
> From: Richard W.M. Jones<rjones at redhat.com>
> Date: Tue, 22 Mar 2011 11:20:38 +0000
> Subject: [PATCH 3/3] inspect: Don't fail for Windows guests with multiple disks (RHBZ#674130).
>
> ---
> src/guestfs-internal.h | 1 +
> src/inspect.c | 11 +++++++++--
> 2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h
> index ccc5bb5..300f1aa 100644
> --- a/src/guestfs-internal.h
> +++ b/src/guestfs-internal.h
> @@ -173,6 +173,7 @@ enum inspect_fs_content {
> FS_CONTENT_UNKNOWN = 0,
> FS_CONTENT_LINUX_ROOT,
> FS_CONTENT_WINDOWS_ROOT,
> + 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 20e8806..716d592 100644
> --- a/src/inspect.c
> +++ b/src/inspect.c
> @@ -366,9 +366,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 ||
> @@ -380,6 +384,9 @@ check_filesystem (guestfs_h *g, const char *device,
> if (check_windows_root (g, fs) == -1)
> return -1;
> }
> + /* Windows volume (but not root)? */
> + else if (is_dir_nocase (g, "/System Volume Information")> 0)
> + fs->content = FS_CONTENT_WINDOWS_VOLUME;
> /* Install CD/disk? Skip these checks if it's not a whole device
> * (eg. CD) or the first partition (eg. bootable USB key).
> */
> -- 1.7.4.1
Ah... previous patch makes more sense in this context. ACK to both.
Matt
--
Matthew Booth, RHCA, RHCSS
Red Hat Engineering, Virtualisation Team
GPG ID: D33C3490
GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
More information about the Libguestfs
mailing list