diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2011-12-09 09:49:37 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-12-09 09:49:37 +0000 |
commit | 54e91da925323642e67b8ce4b95899fe4b7a51c4 (patch) | |
tree | 9ccb40436ad92e1353850fb6ef5a6ecf4f776fe9 /fish/inspect.c | |
parent | 19e2f5aa4fd4ed70b505661d918b5575616ad441 (diff) | |
download | libguestfs-54e91da925323642e67b8ce4b95899fe4b7a51c4.tar.gz libguestfs-54e91da925323642e67b8ce4b95899fe4b7a51c4.tar.xz libguestfs-54e91da925323642e67b8ce4b95899fe4b7a51c4.zip |
fish: -i option should fail if / is not mountable, but warn about others.
In particular this stops a problem with guestmount where if the -i
option half-recognizes the guest OS, it would mount the disk (and
fail, giving only warnings), leaving the mountpoint unusable.
(Thanks Pádraig Brady)
Diffstat (limited to 'fish/inspect.c')
-rw-r--r-- | fish/inspect.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fish/inspect.c b/fish/inspect.c index 7d4401e2..f93367b3 100644 --- a/fish/inspect.c +++ b/fish/inspect.c @@ -154,8 +154,14 @@ inspect_mount_root (const char *root) r = guestfs_mount_options (g, "", mountpoints[i+1], mountpoints[i]); else r = guestfs_mount_ro (g, mountpoints[i+1], mountpoints[i]); - if (r == -1) + if (r == -1) { + /* If the "/" filesystem could not be mounted, give up, else + * just count the errors and print a warning. + */ + if (STREQ (mountpoints[i], "/")) + exit (EXIT_FAILURE); mount_errors++; + } } free_strings (mountpoints); |