Matthew Booth
2010-May-11 17:15 UTC
[Libguestfs] [PATCH] GuestOS: Delete blkid.tab if it's present
--- lib/Sys/VirtV2V/GuestOS/RedHat.pm | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/lib/Sys/VirtV2V/GuestOS/RedHat.pm b/lib/Sys/VirtV2V/GuestOS/RedHat.pm index 7c41ff6..ba37001 100644 --- a/lib/Sys/VirtV2V/GuestOS/RedHat.pm +++ b/lib/Sys/VirtV2V/GuestOS/RedHat.pm @@ -1132,6 +1132,11 @@ sub remap_block_devices $g->aug_set($spec, "/dev/".$map{$name}.$part); } $g->aug_save(); + + # Delete cached (and now out of date) blkid info if it exists + foreach my $blkidtab ('/etc/blkid/blkid.tab', '/etc/blkid.tab') { + $g->rm($blkidtab) if ($g->exists($blkidtab)); + } } sub _drivecmp -- 1.6.6.1
Richard W.M. Jones
2010-May-11 17:54 UTC
[Libguestfs] [PATCH] GuestOS: Delete blkid.tab if it's present
On Tue, May 11, 2010 at 06:15:22PM +0100, Matthew Booth wrote:> --- > lib/Sys/VirtV2V/GuestOS/RedHat.pm | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/lib/Sys/VirtV2V/GuestOS/RedHat.pm b/lib/Sys/VirtV2V/GuestOS/RedHat.pm > index 7c41ff6..ba37001 100644 > --- a/lib/Sys/VirtV2V/GuestOS/RedHat.pm > +++ b/lib/Sys/VirtV2V/GuestOS/RedHat.pm > @@ -1132,6 +1132,11 @@ sub remap_block_devices > $g->aug_set($spec, "/dev/".$map{$name}.$part); > } > $g->aug_save(); > + > + # Delete cached (and now out of date) blkid info if it exists > + foreach my $blkidtab ('/etc/blkid/blkid.tab', '/etc/blkid.tab') { > + $g->rm($blkidtab) if ($g->exists($blkidtab)); > + }ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
Maybe Matching Threads
- [PATCH] GuestOS: Update XF86Config or xorg.conf as appropriate
- [PATCH 1/2] Fix remapping of block devices
- [PATCH] GuestOS: Reload augeas after rpm installation and removal
- [PATCH] GuestOS: Fix error when checking for rpm which isn't installed
- [PATCH] Converter: Remove argument checking from internal functions