Matthew Booth
2010-Apr-07 11:05 UTC
[Libguestfs] [PATCH] v2v: Fix error on exit unmounting transfer ISO
If the transfer iso was mounted during conversion, virt-v2v would always give
the following error on shutdown:
(in cleanup) umount: /tmp/transferb7icam: umount:
/sysroot/tmp/transferb7icam: not found at
/home/mbooth/src/virt-v2v/blib/lib/Sys/VirtV2V/GuestOS/RedHat.pm line 1171.
This was because the GuestOS::RedHat cleanup was being called implicitly on
exit, which is after umount_all has been called explicitly on the libguestfs
handle. This change garbage collects the guestos explicitly before the
libguestfs handle.
---
v2v/virt-v2v.pl | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl
index 08f1c8d..c7ebad3 100755
--- a/v2v/virt-v2v.pl
+++ b/v2v/virt-v2v.pl
@@ -366,6 +366,9 @@ END {
sub close_guest_handle
{
+ # Perform GuestOS cleanup before closing the handle
+ $guestos = undef;
+
if (defined($g)) {
$g->umount_all();
$g->sync();
--
1.6.6.1
Richard W.M. Jones
2010-Apr-08 09:41 UTC
[Libguestfs] [PATCH] v2v: Fix error on exit unmounting transfer ISO
On Wed, Apr 07, 2010 at 12:05:45PM +0100, Matthew Booth wrote:> If the transfer iso was mounted during conversion, virt-v2v would always give > the following error on shutdown: > > (in cleanup) umount: /tmp/transferb7icam: umount: > /sysroot/tmp/transferb7icam: not found at > /home/mbooth/src/virt-v2v/blib/lib/Sys/VirtV2V/GuestOS/RedHat.pm line 1171. > > This was because the GuestOS::RedHat cleanup was being called implicitly on > exit, which is after umount_all has been called explicitly on the libguestfs > handle. This change garbage collects the guestos explicitly before the > libguestfs handle. > --- > v2v/virt-v2v.pl | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl > index 08f1c8d..c7ebad3 100755 > --- a/v2v/virt-v2v.pl > +++ b/v2v/virt-v2v.pl > @@ -366,6 +366,9 @@ END { > > sub close_guest_handle > { > + # Perform GuestOS cleanup before closing the handle > + $guestos = undef; > +Not sure what if anything is the difference between this and undef $guestos; but in any case it looks like a good change, 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
Reasonably Related Threads
- [PATCH] Fix cleanup of guest handle when installing with local files
- [PATCH] Fix cleanup if Ctrl-C kills guestfs qemu process
- [PATCH 1/6] Convert config file to XML, and translate networks/bridge for all connections
- [PATCH 1/9] Convert config file to XML, and translate networks/bridge for all connections
- [PATCH] Improve cleanup of libguestfs handle with Sys::VirtV2V::GuestfsHandle