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