search for: close_guest_handl

Displaying 12 results from an estimated 12 matches for "close_guest_handl".

Did you mean: close_guest_handle
2010 Jun 09
1
[PATCH] Fix cleanup of guest handle when installing with local files
Change 13412f7629133b25fda32c35fdb0276e22de3445 caused Config to keep a reference to the guestfs handle in certain circumstances. This caused a regression in the cleanup code because the handle was no longer closed in close_guest_handle. This change explicitly drops the reference to $config before closing the guest handle. It also localises $guestos, which also keeps a reference to the guestfs handle in an eval block. --- v2v/virt-v2v.pl | 38 ++++++++++++++++++++++++-------------- 1 files changed, 24 insertions(+), 14 deleti...
2010 Jun 08
3
[PATCH 1/3] Fix RHEV cleanup on unclean shutdown
...om or writing to a pipe. +$SIG{'PIPE'} = 'IGNORE'; + # Initialise the message output prefix Sys::VirtV2V::UserMessage->set_identifier('virt-v2v'); @@ -362,9 +370,6 @@ if ($output_method eq 'rhev') { $> = "0"; } -$SIG{'INT'} = \&close_guest_handle; -$SIG{'QUIT'} = \&close_guest_handle; - # Inspect the guest my $os = inspect_guest($g); @@ -425,6 +430,12 @@ sub close_guest_handle } } +sub signal_exit +{ + close_guest_handle(); + exit(1); +} + sub get_guestfs_handle { my ($storage, $transferiso) = @_; -- 1...
2010 Apr 07
1
[PATCH] v2v: Fix error on exit unmounting transfer ISO
...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
2010 Jun 09
1
[PATCH] Fix cleanup if Ctrl-C kills guestfs qemu process
...rted, which is undesirable. Additional fix to RHBZ#596015 --- v2v/virt-v2v.pl | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl index 1ab8fdc..726cd50 100755 --- a/v2v/virt-v2v.pl +++ b/v2v/virt-v2v.pl @@ -414,11 +414,18 @@ sub close_guest_handle $guestos = undef; if (defined($g)) { - $g->umount_all(); - $g->sync(); - my $retval = $?; + eval { + $g->umount_all(); + $g->sync(); + }; + if ($@) { + warn(user_message(__x("Error cleaning...
2010 Jun 17
2
[PATCH] Improve cleanup of libguestfs handle with Sys::VirtV2V::GuestfsHandle
...new Sys::VirtV2V::GuestfsHandle($storage, $transferiso, + $output_method eq 'rhev'); my $os; my $guestcaps; @@ -390,11 +382,11 @@ eval { # can result in failure to umount RHEV export's temporary mount point. if ($@) { my $err = $@; - close_guest_handle(); + $g->close(); die($err); } -close_guest_handle(); +$g->close(); $target->create_guest($os, $dom, $guestcaps); @@ -418,58 +410,10 @@ END { ############################################################################### ## Helper functions -sub close_guest_handle -{...
2010 Apr 26
2
[PATCH] Fix virt-v2v exit codes
...rror => $!)); + + $? = $retval; } =item create_volume(name, size) diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl index 15d0d5b..7951303 100755 --- a/v2v/virt-v2v.pl +++ b/v2v/virt-v2v.pl @@ -350,6 +350,9 @@ exit(0); # We should always attempt to shut down the guest gracefully END { close_guest_handle(); + + # die() sets $? to 255, which is untidy. + $? = $? == 255 ? 1 : $?; } ############################################################################### @@ -364,10 +367,14 @@ sub close_guest_handle $g->umount_all(); $g->sync(); + my $retval = $? +...
2010 Feb 09
5
[PATCH 1/6] Convert config file to XML, and translate networks/bridge for all connections
Previously, only the LibVirtXML connection translated network and bridge names in imported metadata. This change moves this functionality in Converter, making it available to LibVirt connections as well. At the same time, the format of the config file is switched to XML. The primary driver for this is that the allowable syntax of a foreign network/bridge name is not known. Rather than create a
2010 Jun 08
2
[PATCH 1/2] Target: Pass os description to create_guest
...he name of the guest my ($name) = $dom->findnodes('/domain/name/text()'); diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl index bed69a0..96e89d1 100755 --- a/v2v/virt-v2v.pl +++ b/v2v/virt-v2v.pl @@ -378,7 +378,7 @@ my $guestcaps = Sys::VirtV2V::Converter->convert($g, $guestos, close_guest_handle(); -$target->create_guest($dom, $guestcaps); +$target->create_guest($os, $dom, $guestcaps); my ($name) = $dom->findnodes('/domain/name/text()'); $name = $name->getNodeValue(); -- 1.7.0.1
2010 Feb 19
2
[PATCH 1/2] Fix remapping of block devices
...Create the transfer iso if required my $transferiso = get_transfer_iso($config, $config_file); # Open a libguestfs handle on the guest's storage devices -my $g = get_guestfs_handle(\@storage, $transferiso); +my $g = get_guestfs_handle($storage, $transferiso); $SIG{'INT'} = \&close_guest_handle; $SIG{'QUIT'} = \&close_guest_handle; @@ -280,7 +280,8 @@ my $os = inspect_guest($g); my $guestos = Sys::VirtV2V::GuestOS->new($g, $os, $dom, $config); # Modify the guest and its metadata for the target hypervisor -Sys::VirtV2V::Converter->convert($vmm, $guestos, $config, $d...
2010 Mar 30
3
[PATCH 1/2] Refactor guest and volume creation into Sys::VirtV2V::Target::LibVirt
Move all target-specific functionality into its own module in preparation for output to RHEV. --- MANIFEST | 1 + lib/Sys/VirtV2V/Connection.pm | 46 ++--- lib/Sys/VirtV2V/Converter.pm | 138 +------------ lib/Sys/VirtV2V/Target/LibVirt.pm | 419 +++++++++++++++++++++++++++++++++++++ lib/Sys/VirtV2V/Transfer/ESX.pm | 91 +++------ po/POTFILES.in
2010 Feb 12
11
[PATCH 1/9] Convert config file to XML, and translate networks/bridge for all connections
Previously, only the LibVirtXML connection translated network and bridge names in imported metadata. This change moves this functionality in Converter, making it available to LibVirt connections as well. At the same time, the format of the config file is switched to XML. The primary driver for this is that the allowable syntax of a foreign network/bridge name is not known. Rather than create a
2010 Apr 08
1
[PATCH] Move all interaction with the config file into Sys::VirtV2V::Config
...rage_paths(); # Create the transfer iso if required -my $transferiso = get_transfer_iso($config, $config_file); +my $transferiso; +$transferiso = $config->get_transfer_iso() if (defined($config)); if ($output_method eq 'rhev') { $) = "36 36"; @@ -380,80 +366,6 @@ sub close_guest_handle } } -sub get_transfer_iso -{ - my ($config, $config_file) = @_; - - # Nothing to do if there's no config - return undef unless (defined($config)); - - # path-root doesn't have to be defined - my ($root) = $config->findnodes('/virt-v2v/path-root/text()'); -...