Assaf Gordon
2017-Nov-06 23:04 UTC
[Libguestfs] minor usability issue: confusing error message with guestmount + fuse errors
Hello, Using older libguestfs 1.34.6-2 (from Ubuntu's standard package), I encountered this: libguestfs fails with an error, but the error code is "success": $ sudo guestmount -m /dev/sda1 --ro \ -o allow_others \ -a data.qcow2 \ /media/foo fuse: unknown option `allow_others' libguestfs: error: fuse_new: /media/foo/: Success Other fuse errors also cause the same behavior, e.g. mounting to an already-mounted directory: $ sudo guestmount -m /dev/sda1 --ro -a data2.qcow2 /media/foo /media/foo mountpoint is not empty fuse: mountpoint is not empty fuse: if you are sure this is safe, use the 'nonempty' mount option libguestfs: error: fuse_mount: /media/foo: Success I guess libguestfs uses the most recent 'errno' to report the error string, but it is zero (because the error was somewhere deeper, in fuse). regards, - assaf
Richard W.M. Jones
2017-Nov-14 09:43 UTC
Re: [Libguestfs] minor usability issue: confusing error message with guestmount + fuse errors
[Sorry for missing this email] On Mon, Nov 06, 2017 at 04:04:18PM -0700, Assaf Gordon wrote:> Hello, > > Using older libguestfs 1.34.6-2 (from Ubuntu's standard package), > I encountered this: > > libguestfs fails with an error, but the error code is "success": > > $ sudo guestmount -m /dev/sda1 --ro \ > -o allow_others \ > -a data.qcow2 \ > /media/foo > fuse: unknown option `allow_others' > libguestfs: error: fuse_new: /media/foo/: Success > > Other fuse errors also cause the same behavior, > e.g. mounting to an already-mounted directory: > > $ sudo guestmount -m /dev/sda1 --ro -a data2.qcow2 /media/foo > /media/foo mountpoint is not empty > fuse: mountpoint is not empty > fuse: if you are sure this is safe, use the 'nonempty' mount option > libguestfs: error: fuse_mount: /media/foo: SuccessI can reproduce this bug: $ touch mnt/foo $ guestmount -a test1.img -m /dev/sda1 /var/tmp/mntfuse: mountpoint is not empty fuse: if you are sure this is safe, use the 'nonempty' mount option libguestfs: error: fuse_mount: /var/tmp/mnt: Success I added this fix: https://github.com/libguestfs/libguestfs/commit/a88385add653c4fc2592639d72b638f693798091 Thanks, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Maybe Matching Threads
- guestfs_mount_local api test: have to 'mount' before calling it?
- Re: [PATCH libnbd] nbdfuse: New tool to present a network block device in a FUSE filesystem.
- [PATCH libnbd] nbdfuse: New tool to present a network block device in a FUSE filesystem.
- Fuse problem
- sshfs mounting on Centos 6.9