[Libguestfs] Supporting btrfs subvolumes during inspection

Richard W.M. Jones rjones at redhat.com
Fri Dec 21 11:23:10 UTC 2012

On Fri, Dec 21, 2012 at 11:20:44AM +0000, Richard W.M. Jones wrote:
>      for ($mp, $subvol) (@mps) {
>          if (!$subvol) {
>              $g->mount_ro ($mps{$mp}, $mp);
>          } elsif ($g->vfs_type ($mp) eq "btrfs") {
>              $g->mount_options ("subvol=$subvol", $mps{$mp}, $mp);
>          } elsif ($g->vfs_type ($mp) eq "zfs") {
>              $g->mount_options ("something=$subvol", $mps{$mp}, $mp);
>          } else {
>              die "sorry we don't know how to mount this"
>          }
>      }

Hmmm, maybe a subvol => ... parameter to mount?

Also I think vfs_type is a red herring since a subvolume would not
have a separate filesystem type.  However there may be other calls
which need to be examined; I can't say without a thorough review.


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.

More information about the Libguestfs mailing list