On Wed, Oct 21, 2015 at 03:44:28PM +0300, Maxim Perevedentsev wrote:
On 10/20/2015 08:58 PM, Richard W.M. Jones wrote:
On Tue, Oct 20, 2015 at 08:56:25PM +0300, Maxim Perevedentsev wrote:
I have an issue with btrfs:
btrfs inspect-internal min-dev-size /sysroot/ But this API is available only in btrfs-progs >= 4.2. Before this, there's no reliable way to get minimum size (I could
There's an API parse "btrfs filesystem show", but it is veeery inaccurate).
Can we require btrfs-progs v4.2? Or how should I work-around this issue? Well it's a new API, so we can just tell people they need new btrfs-progs if they want to use the new API.
It would be a problem if we were changing an old API, but that's not the case here.
Rich. OK. I have another question:
The call for ext works on mounted and unmounted fs. for ntfs on read-only-mounted and unmounted. for btrfs on mounted (ro and rw). for xfs on mounted (ro and rw) (xfs does not support shrinking, so guestfs_xfs_info).
Should we require the user to care about fs mount status / do mounts/unmounts ourselves (how to choose mountpoint?) / refuse to work if fs is not ro-mounted?
I would vote for 1st option: include mount check into functions and politely report incompatible mount status to user.
Ideally the user wouldn't have to care about the filesystem type, so I think your solution is the best one. If you don't do an explicit mount check, is the error message clear enough? Doing an actual mount check is complicated. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v