[Pkg-libvirt-commits] [libguestfs] 53/78: listfs: If LDM not available, don't inhibit partition detection (RHBZ#1079182).

Hilko Bengen bengen at moszumanska.debian.org
Fri May 9 12:55:54 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch experimental
in repository libguestfs.

commit 47ec61e9af19f8a750750ad498adc10fa7ae0521
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Fri Mar 21 15:24:01 2014 +0000

    listfs: If LDM not available, don't inhibit partition detection (RHBZ#1079182).
    
    If a disk has type 0x42 partition (which would indicate LDM), but LDM
    is not available then try parsing the partition anyway.  It might be
    parseable as plain old NTFS.
---
 src/listfs.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/listfs.c b/src/listfs.c
index bbdb0a2..ffb0adc 100644
--- a/src/listfs.c
+++ b/src/listfs.c
@@ -47,8 +47,11 @@ guestfs__list_filesystems (guestfs_h *g)
 {
   size_t i;
   DECLARE_STRINGSBUF (ret);
+
   const char *lvm2[] = { "lvm2", NULL };
+  int has_lvm2 = guestfs_feature_available (g, (char **) lvm2);
   const char *ldm[] = { "ldm", NULL };
+  int has_ldm = guestfs_feature_available (g, (char **) ldm);
 
   CLEANUP_FREE_STRING_LIST char **devices = NULL;
   CLEANUP_FREE_STRING_LIST char **partitions = NULL;
@@ -83,7 +86,7 @@ guestfs__list_filesystems (guestfs_h *g)
 
   /* Use vfs-type to check for filesystems on partitions. */
   for (i = 0; partitions[i] != NULL; ++i) {
-    if (! is_mbr_partition_type_42 (g, partitions[i])) {
+    if (has_ldm == 0 || ! is_mbr_partition_type_42 (g, partitions[i])) {
       if (check_with_vfs_type (g, partitions[i], &ret) == -1)
         goto error;
     }
@@ -94,7 +97,7 @@ guestfs__list_filesystems (guestfs_h *g)
     if (check_with_vfs_type (g, mds[i], &ret) == -1)
       goto error;
 
-  if (guestfs_feature_available (g, (char **) lvm2)) {
+  if (has_lvm2 > 0) {
     /* Use vfs-type to check for filesystems on LVs. */
     lvs = guestfs_lvs (g);
     if (lvs == NULL) goto error;
@@ -104,7 +107,7 @@ guestfs__list_filesystems (guestfs_h *g)
         goto error;
   }
 
-  if (guestfs_feature_available (g, (char **) ldm)) {
+  if (has_ldm > 0) {
     /* Use vfs-type to check for filesystems on Windows dynamic disks. */
     ldmvols = guestfs_list_ldm_volumes (g);
     if (ldmvols == NULL) goto error;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list