summaryrefslogtreecommitdiffstats
path: root/fish/inspect.c
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-01-11 10:43:51 +0000
committerRichard W.M. Jones <rjones@redhat.com>2011-01-11 11:09:41 +0000
commit0c60e4d9dd6549c2135699490ba8a9ec1dd50ab9 (patch)
tree25e5e1f71bb285fd4964bf2c6c1489656e74a241 /fish/inspect.c
parentfc241abdbac7a016cd2fac169ad64876107df3c8 (diff)
downloadlibguestfs-0c60e4d9dd6549c2135699490ba8a9ec1dd50ab9.tar.gz
libguestfs-0c60e4d9dd6549c2135699490ba8a9ec1dd50ab9.tar.xz
libguestfs-0c60e4d9dd6549c2135699490ba8a9ec1dd50ab9.zip
fish: Don't fail if some mountpoints in /etc/fstab are bogus (RHBZ#668574).
Fix guestfish (and other C tools) so that they ignore errors when /etc/fstab contains bogus entries. Update the documentation for inspect-get-mountpoints to emphasize that callers must be aware of this when mounting the returned values. Add a regression test. Update the example code ("inspect_vm") to reflect the way this API ought to be called. For more detail see: https://bugzilla.redhat.com/show_bug.cgi?id=668574
Diffstat (limited to 'fish/inspect.c')
-rw-r--r--fish/inspect.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fish/inspect.c b/fish/inspect.c
index 28c1b88b..713501e9 100644
--- a/fish/inspect.c
+++ b/fish/inspect.c
@@ -111,6 +111,7 @@ inspect_mount_root (const char *root)
compare_keys_len);
size_t i;
+ size_t mount_errors = 0;
for (i = 0; mountpoints[i] != NULL; i += 2) {
int r;
if (!read_only)
@@ -118,10 +119,14 @@ inspect_mount_root (const char *root)
else
r = guestfs_mount_ro (g, mountpoints[i+1], mountpoints[i]);
if (r == -1)
- exit (EXIT_FAILURE);
+ mount_errors++;
}
free_strings (mountpoints);
+
+ if (mount_errors)
+ fprintf (stderr, _("%s: some filesystems could not be mounted (ignored)\n"),
+ program_name);
}
/* This function is called only if the above function was called,