[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] [PATCH 2/2] GuestOS: Always call aug_save() after aug_set()



Once more, with added syntactic correctness (attached).
-- 
Matthew Booth, RHCA, RHCSS
Red Hat Engineering, Virtualisation Team

M:       +44 (0)7977 267231
GPG ID:  D33C3490
GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
>From de9e464423be060b9841a5f1c06c373c0a0a7bdc Mon Sep 17 00:00:00 2001
From: Matthew Booth <mbooth redhat com>
Date: Fri, 19 Feb 2010 16:33:25 +0000
Subject: [PATCH] GuestOS: Always call aug_save() after aug_set()

We call aug_load() in various places. This call explicitly throws away any
unsaved changes in the tree. For safety, we should always call aug_save() after
making changes to the tree. This change adds 2 missing calls.
---
 lib/Sys/VirtV2V/GuestOS/RedHat.pm |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/Sys/VirtV2V/GuestOS/RedHat.pm b/lib/Sys/VirtV2V/GuestOS/RedHat.pm
index 6adf8b8..3f5d90a 100644
--- a/lib/Sys/VirtV2V/GuestOS/RedHat.pm
+++ b/lib/Sys/VirtV2V/GuestOS/RedHat.pm
@@ -265,7 +265,8 @@ sub enable_kernel_module
     eval {
         $g->aug_set("/files/".$self->{modules}."/alias[last()+1]", $device);
         $g->aug_set("/files/".$self->{modules}."/alias[last()]/modulename",
-                    $module)
+                    $module);
+        $g->aug_save();
     };
 
     # Propagate augeas errors
@@ -1113,6 +1114,7 @@ sub prepare_bootable
                 last;
             }
         }
+        $g->aug_save();
     };
 
     # Propagate augeas failure
-- 
1.6.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]