From: Richard W.M. Jones Date: Fri, 9 Dec 2011 09:49:37 +0000 (+0000) Subject: fish: -i option should fail if / is not mountable, but warn about others. X-Git-Tag: 1.15.11~2 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=54e91da925323642e67b8ce4b95899fe4b7a51c4;p=libguestfs.git 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) --- diff --git a/fish/inspect.c b/fish/inspect.c index 7d4401e..f93367b 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);