Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fuse: In mount-local-run, test if root filesystem has been mounted (R…
…HBZ#1057504). It is never normally valid to use the mount-local* APIs when you haven't mounted some filesystems in the libguestfs namespace. If you try it, it results in some odd errors. The mount-local-run call is successful, but subsequent operations fail: $ mkdir -p /tmp/mnt $ guestfish -x -N fs mount-local /tmp/mnt : mount-local-run libguestfs: error: lstat: lstat_stub: you must call 'mount' first to mount the root filesystem libguestfs: error: lstat: lstat_stub: you must call 'mount' first to mount the root filesystem With this commit, the mount-local-run call gives an error: libguestfs: error: you must call 'guestfs_mount' first to mount a filesystem on '/'. Note: '/tmp/mnt' is still mounted. Use 'guestunmount /tmp/mnt' to clean up. The error is implemented by calling guestfs_exists (g, "/") which has the side effect of running the NEED_ROOT macro in the daemon. (There is no simple equivalent of NEED_ROOT on the library side.)
- Loading branch information