[Libguestfs] [PATCH 1/3] daemon: directly use Optgroups

Pino Toscano ptoscano at redhat.com
Mon Apr 9 14:06:30 UTC 2018


Avoid extra module variables, and just use Optgroups directly.
---
 daemon/ldm.ml    | 2 --
 daemon/ldm.mli   | 2 --
 daemon/listfs.ml | 4 ++--
 daemon/lvm.ml    | 2 --
 daemon/lvm.mli   | 2 --
 5 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/daemon/ldm.ml b/daemon/ldm.ml
index c17766600..b48b0f4eb 100644
--- a/daemon/ldm.ml
+++ b/daemon/ldm.ml
@@ -20,8 +20,6 @@ open Std_utils
 
 open Utils
 
-let available = Optgroups.ldm_available
-
 (* All device mapper devices are called /dev/mapper/ldm_vol_*
  * or /dev/mapper/ldm_part_*.
  *
diff --git a/daemon/ldm.mli b/daemon/ldm.mli
index a45948910..74afdf5d8 100644
--- a/daemon/ldm.mli
+++ b/daemon/ldm.mli
@@ -16,7 +16,5 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *)
 
-val available : unit -> bool
-
 val list_ldm_volumes : unit -> string list
 val list_ldm_partitions : unit -> string list
diff --git a/daemon/listfs.ml b/daemon/listfs.ml
index 370ffb4f4..f6e3dcd6e 100644
--- a/daemon/listfs.ml
+++ b/daemon/listfs.ml
@@ -21,8 +21,8 @@ open Printf
 open Std_utils
 
 let rec list_filesystems () =
-  let has_lvm2 = Lvm.available () in
-  let has_ldm = Ldm.available () in
+  let has_lvm2 = Optgroups.lvm2_available () in
+  let has_ldm = Optgroups.ldm_available () in
 
   let devices = Devsparts.list_devices () in
   let partitions = Devsparts.list_partitions () in
diff --git a/daemon/lvm.ml b/daemon/lvm.ml
index 467495f7e..ed4ed7462 100644
--- a/daemon/lvm.ml
+++ b/daemon/lvm.ml
@@ -23,8 +23,6 @@ open Std_utils
 
 open Utils
 
-let available = Optgroups.lvm2_available
-
 (* Check whether lvs has -S to filter its output.
  * It is available only in lvm2 >= 2.02.107. 
  *)
diff --git a/daemon/lvm.mli b/daemon/lvm.mli
index 94a35d83c..e9a6faeca 100644
--- a/daemon/lvm.mli
+++ b/daemon/lvm.mli
@@ -16,8 +16,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *)
 
-val available : unit -> bool
-
 val lvs : unit -> string list
 
 val lv_canonical : string -> string option
-- 
2.14.3




More information about the Libguestfs mailing list