summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-09-16 15:26:20 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-09-16 15:26:20 +0100
commit917f947590c92318fee2545ba88245d0de012e31 (patch)
treef86f28f51665dc96fbca378868926d3811fcdd30 /src
parentb648b1813fc8e55db790435b5414d9be3ec765d2 (diff)
downloadlibguestfs-917f947590c92318fee2545ba88245d0de012e31.tar.gz
libguestfs-917f947590c92318fee2545ba88245d0de012e31.tar.xz
libguestfs-917f947590c92318fee2545ba88245d0de012e31.zip
inspection: Handle /dev/root in /etc/fstab.
This means "the device that holds /etc/fstab", so map it correctly. This fixes support for ttylinux and also some other guests that use /dev/root instead of a real device name.
Diffstat (limited to 'src')
-rw-r--r--src/inspect_fs_unix.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/inspect_fs_unix.c b/src/inspect_fs_unix.c
index 42707128..00d3cd7d 100644
--- a/src/inspect_fs_unix.c
+++ b/src/inspect_fs_unix.c
@@ -704,6 +704,9 @@ add_fstab_entry (guestfs_h *g, struct inspect_fs *fs,
else if (STRPREFIX (spec, "LABEL="))
device = guestfs_findfs_label (g, &spec[6]);
/* Ignore "/.swap" (Pardus) and pseudo-devices like "tmpfs". */
+ else if (STREQ (spec, "/dev/root"))
+ /* Resolve /dev/root to the current device. */
+ device = safe_strdup (g, fs->device);
else if (STRPREFIX (spec, "/dev/"))
/* Resolve guest block device names. */
device = resolve_fstab_device (g, spec);