[Libguestfs] [PATCH] Added btrfs support for vfs_min_size.

Maxim Perevedentsev mperevedentsev at virtuozzo.com
Fri Oct 23 15:48:29 UTC 2015


On 23.10.2015 12:13, Richard W.M. Jones wrote:
> On Thu, Oct 22, 2015 at 08:05:37PM +0300, Maxim Perevedentsev wrote:
>> +static char*
>> +get_mount_point (const char *device)
>> +{
> This function now exists in daemon/mount.c and here.  It should
> be shared.  Just make the function in daemon/mount.c non-static,
> and declare it in daemon/guestfsd.h, and you don't need the copy.
There's a difference in this function and mount.c: is_device_mounted()

get_mount_point: return ANY of mount points for specific device.
is_device_mounted: return whether a device has a mountpoint under /sysroot

Even
is_device_mounted()
{
   return (get_mount_point() != NULL);
}
may not work in case of multiple mountpoints, some under /sysroot and 
others - not.
So it's not obvious how to merge(?) these functions.

Other way is to use do_mountpoints() and check the returned hash (but 
this will have malloc overhead).

-- 
С уважением, Максим Переведенцев
Your sincerely, Maxim Perevedentsev




More information about the Libguestfs mailing list