[Pkg-libvirt-commits] [libguestfs] 44/384: Fix fstab block device resolution for FreeBSD

Hilko Bengen bengen at moszumanska.debian.org
Sun Mar 29 16:55:19 UTC 2015


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

bengen pushed a commit to branch experimental
in repository libguestfs.

commit b58022eca783cbc8662c6c393727aa7748e42f5f
Author: Nikos Skalkotos <skalkoto at grnet.gr>
Date:   Wed Dec 3 16:12:22 2014 +0200

    Fix fstab block device resolution for FreeBSD
    
    Take into granted that partition 'c' has a special purpose. It has
    always the same size as the enclosing slice and is not mapped under
    Linux.
    
    This is a best effort try. The mapping will be incorrect if there is a
    gap in the disklabel partitions sequence, e.g. 'b' (swap) partition is
    missing but 'd' partition is defined.
    
    Signed-off-by: Nikos Skalkotos <skalkoto at grnet.gr>
---
 src/inspect-fs-unix.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c
index 18be68b..b3c813d 100644
--- a/src/inspect-fs-unix.c
+++ b/src/inspect-fs-unix.c
@@ -1624,9 +1624,13 @@ resolve_fstab_device (guestfs_h *g, const char *spec, Hash_table *md_map,
     free (slice);
     free (part);
 
+    if (part_i > 2)
+      /* Partition 'c' has the size of the enclosing slice. Not mapped under Linux. */
+      part_i -= 1;
+
     if (disk_i != -1 && disk_i <= 26 &&
         slice_i > 0 && slice_i <= 1 /* > 4 .. see comment above */ &&
-        part_i >= 0 && part_i < 26) {
+        part_i >= 0 && part_i < 25) {
       device = safe_asprintf (g, "/dev/sd%c%d", disk_i + 'a', part_i + 5);
     }
   }

-- 
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