[Libguestfs] [PATCH 2/2] v2v: fix priority of match in configure_kernel_modules

Pino Toscano
Fri, 01 Jul 2016 15:52:01 -0000

This makes sure that in the internal configure_kernel_modules function,
for virtio or SCSI block types:
a) the warnings about leftover Xen modules are printed
b) the changes in Augeas are saved
---
 v2v/convert_linux.ml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml
index 0296844..a5ba8dd 100644
--- a/v2v/convert_linux.ml
+++ b/v2v/convert_linux.ml
@@ -1147,7 +1147,7 @@ let rec convert ~keep_serial_console (g : G.guestfs)
inspect source rcaps
     (* Update 'alias scsi_hostadapter ...' *)
     let paths = augeas_modprobe ". =~
regexp('scsi_hostadapter.*')" in
-    match block_type with
+    (match block_type with
     | Virtio_blk | Virtio_SCSI ->
       let block_module          match block_type with
@@ -1180,7 +1180,7 @@ let rec convert ~keep_serial_console (g : G.guestfs)
inspect source rcaps      | IDE ->
       (* There is no scsi controller in an IDE guest. *)
       List.iter (fun path -> ignore (g#aug_rm path)) (List.rev paths)
-    ;
+    );

     (* Display a warning about any leftover Xen modules which we
      * haven't converted.  These are likely to cause an error when
--
2.5.5