[Pkg-libvirt-commits] [libguestfs] 74/116: v2v: Don't change Augeas device entries unless the value has changed.

Hilko Bengen bengen at moszumanska.debian.org
Wed Nov 26 22:05:19 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag debian/1%1.29.10-1
in repository libguestfs.

commit 4c7026fb7a7514838a01771abb4c7e62a4e4485f
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Tue Nov 18 13:37:21 2014 +0000

    v2v: Don't change Augeas device entries unless the value has changed.
    
    When remapping block devices, don't change an entry unless its value
    has changed.  This avoids unnecessary Augeas writes.
---
 v2v/convert_linux.ml | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml
index 434a4f2..088c2e8 100644
--- a/v2v/convert_linux.ml
+++ b/v2v/convert_linux.ml
@@ -1337,7 +1337,7 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source =
       fun path ->
         let value = g#aug_get path in
 
-        let value =
+        let new_value =
           (* Handle grub2 resume=<dev> specially. *)
           if string_find path "GRUB_CMDLINE" >= 0 then (
             if Str.string_match rex_resume value 0 then (
@@ -1351,8 +1351,10 @@ let rec convert ~verbose ~keep_serial_console (g : G.guestfs) inspect source =
           )
           else replace_if_device path value in
 
-        g#aug_set path value;
-        changed := true
+        if value <> new_value then (
+          g#aug_set path new_value;
+          changed := true
+        )
     ) paths;
 
     if !changed then (

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list