X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Finspect.c;h=f9b8298858701ee456455c62f5d9859cdd4c1c26;hb=56b3b40603a95b09a0f34c2e49143bc7b40cbdfd;hp=e83e8241cf6a7a64f692a43a1074af3fcf54550d;hpb=f5172902bc9d92451c83dc3c1a85b5aeb975b43a;p=libguestfs.git diff --git a/src/inspect.c b/src/inspect.c index e83e824..f9b8298 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; @@ -719,7 +733,7 @@ guestfs___download_to_tmp (guestfs_h *g, struct inspect_fs *fs, int64_t size; /* Make the basename unique by prefixing it with the fs number. */ - if (asprintf (&r, "%s/%ld-%s", g->tmpdir, fs - g->fses, basename) == -1) { + if (asprintf (&r, "%s/%td-%s", g->tmpdir, fs - g->fses, basename) == -1) { perrorf (g, "asprintf"); return NULL; }