Re: [Libguestfs] [PATCHv4 0/2] Introduce vfs_minimum_size API to get minimum filesystem size.

Pino Toscano
Wed, 21 Oct 2015 12:51:32 -0000

On Tuesday 20 October 2015 20:56:25 Maxim Perevedentsev
wrote:
> I have an issue with btrfs:
>
> There's an API
>  > 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 parse
> "btrfs filesystem show", but it is veeery inaccurate).
>
> Can we require btrfs-progs v4.2? Or how should I work-around this issue?

The usual way in cases like this is to detect whether the needed tools
are available, or the needed versions of them, and if not report an
error (or just ENOTSUP).  See for example the btrfs code for setting the
UUID in a btrfs filesystem (daemon/btrfs.c:btrfs_set_uuid).

--
Pino Toscano