mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
mllib: add checking for btrfs subvolume
This is needed to skip btrfs subvolumes from output of list_filesystems where device is needed.
This commit is contained in:
committed by
Richard W.M. Jones
parent
abf85b050e
commit
d6bba9bc42
@@ -942,3 +942,10 @@ let inspect_mount_root g ?mount_opts_fn root =
|
||||
|
||||
let inspect_mount_root_ro =
|
||||
inspect_mount_root ~mount_opts_fn:(fun _ -> "ro")
|
||||
|
||||
let is_btrfs_subvolume g fs =
|
||||
try
|
||||
ignore (g#mountable_subvolume fs); true
|
||||
with Guestfs.Error msg as exn ->
|
||||
if g#last_errno () = Guestfs.Errno.errno_EINVAL then false
|
||||
else raise exn
|
||||
|
||||
@@ -368,3 +368,6 @@ val inspect_mount_root : Guestfs.guestfs -> ?mount_opts_fn:(string -> string) ->
|
||||
val inspect_mount_root_ro : Guestfs.guestfs -> string -> unit
|
||||
(** Like [inspect_mount_root], but mounting every mount point as
|
||||
read-only. *)
|
||||
|
||||
val is_btrfs_subvolume : Guestfs.guestfs -> string -> bool
|
||||
(** Checks if a filesystem is a btrfs subvolume. *)
|
||||
|
||||
Reference in New Issue
Block a user