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

Richard W.M. Jones rjones at redhat.com
Mon Feb 22 10:02:55 UTC 2010


On Fri, Feb 19, 2010 at 05:07:23PM +0000, Matthew Booth wrote:
> Once more, with added syntactic correctness (attached).

> 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

ACK.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw




More information about the Libguestfs mailing list