X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Finspect.c;h=a7291da4de6368e0a93b7dc6ab2be0dc650fbf05;hb=27d00960c93b26c68fa1f4068502c32a6e3b5e94;hp=1b41be58be2904e9d108249b5740f1af712123ae;hpb=5d48250224fcb140b7e6e17f36b37deab4e0659b;p=libguestfs.git diff --git a/src/inspect.c b/src/inspect.c index 1b41be5..a7291da 100644 --- a/src/inspect.c +++ b/src/inspect.c @@ -61,8 +61,7 @@ guestfs__inspect_os (guestfs_h *g) * information to the handle. */ /* Look to see if any devices directly contain filesystems (RHBZ#590167). */ - char **devices; - devices = guestfs_list_devices (g); + char **devices = guestfs_list_devices (g); if (devices == NULL) return NULL; @@ -77,8 +76,7 @@ guestfs__inspect_os (guestfs_h *g) guestfs___free_string_list (devices); /* Look at all partitions. */ - char **partitions; - partitions = guestfs_list_partitions (g); + char **partitions = guestfs_list_partitions (g); if (partitions == NULL) { guestfs___free_inspect_info (g); return NULL; @@ -93,6 +91,22 @@ guestfs__inspect_os (guestfs_h *g) } guestfs___free_string_list (partitions); + /* Look at MD devices. */ + char **mds = guestfs_list_md_devices (g); + if (mds == NULL) { + guestfs___free_inspect_info (g); + return NULL; + } + + for (i = 0; mds[i] != NULL; ++i) { + if (guestfs___check_for_filesystem_on (g, mds[i], 0, i+1) == -1) { + guestfs___free_string_list (mds); + guestfs___free_inspect_info (g); + return NULL; + } + } + guestfs___free_string_list (mds); + /* Look at all LVs. */ if (guestfs___feature_available (g, "lvm2")) { char **lvs; @@ -175,6 +189,7 @@ guestfs__inspect_get_type (guestfs_h *g, const char *root) char *ret; switch (fs->type) { case OS_TYPE_FREEBSD: ret = safe_strdup (g, "freebsd"); break; + case OS_TYPE_HURD: ret = safe_strdup (g, "hurd"); break; case OS_TYPE_LINUX: ret = safe_strdup (g, "linux"); break; case OS_TYPE_NETBSD: ret = safe_strdup (g, "netbsd"); break; case OS_TYPE_WINDOWS: ret = safe_strdup (g, "windows"); break;