[virt-v2v/f16] Add missing patch
Matthew Booth
mdbooth at fedoraproject.org
Tue Dec 13 14:42:33 UTC 2011
commit 143746c2524ecc33a5d8279060edeab8a0344a96
Author: Matthew Booth <mbooth at redhat.com>
Date: Tue Dec 13 14:42:12 2011 +0000
Add missing patch
virt-v2v-0.8.5-00-786a74f0.patch | 101 ++++++++++++++++++++++++++++++++++++++
1 files changed, 101 insertions(+), 0 deletions(-)
---
diff --git a/virt-v2v-0.8.5-00-786a74f0.patch b/virt-v2v-0.8.5-00-786a74f0.patch
new file mode 100644
index 0000000..19cac20
--- /dev/null
+++ b/virt-v2v-0.8.5-00-786a74f0.patch
@@ -0,0 +1,101 @@
+commit 786a74f0f1c14cfb54a65ea8c5fc097f612b03a5
+Author: Matthew Booth <mbooth at redhat.com>
+Date: Tue Dec 13 14:18:10 2011 +0000
+
+ Fix crash during format conversions
+
+ Fix a regression introduced by commit 6dec2753fd9e7d726e140bb246ccf32df8af9fb5.
+ We didn't update the format conversion code when updating the GuestfsHandle API.
+ This change updates the API again, removing an unnecessary dependency between
+ GuestfsHandle and Volume.
+
+diff --git a/lib/Sys/VirtConvert/GuestfsHandle.pm b/lib/Sys/VirtConvert/GuestfsHandle.pm
+index f6fa63f..fe34d14 100644
+--- a/lib/Sys/VirtConvert/GuestfsHandle.pm
++++ b/lib/Sys/VirtConvert/GuestfsHandle.pm
+@@ -57,9 +57,9 @@ close() method, and the ability to register pre-close callbacks.
+ =item new(disks, transferiso, isrhev)
+
+ Create a new object. Open a new Sys::Guestfs handle to proxy, using the disks
+-defined in I<disks>, which is taken from the guest metadata. Add I<transferiso>
+-as a read-only drive if it is given. If I<isrhev> is true, the handle will use
+-user and group 36:36.
++defined in I<disks>, which is list of disk metadata defined as: [ [ name, path,
++format ], ... ]. Add I<transferiso> as a read-only drive if it is given. If
++I<isrhev> is true, the handle will use user and group 36:36.
+
+ =cut
+
+@@ -77,12 +77,12 @@ sub new
+
+ $g = Sys::Guestfs->new();
+ foreach my $disk (@{$disks}) {
+- my $vol = $disk->{dst};
++ my ($name, $path, $format) = @$disk;
+
+- $g->add_drive_opts($vol->get_path(),
+- format => $vol->get_format(),
++ $g->add_drive_opts($path,
++ format => $format,
+ iface => $interface,
+- name => $disk->{device});
++ name => $name);
+ }
+
+ # Add the transfer iso if there is one
+diff --git a/lib/Sys/VirtConvert/Transfer/Local.pm b/lib/Sys/VirtConvert/Transfer/Local.pm
+index 667b282..5053ccb 100644
+--- a/lib/Sys/VirtConvert/Transfer/Local.pm
++++ b/lib/Sys/VirtConvert/Transfer/Local.pm
+@@ -179,12 +179,13 @@ package Sys::VirtConvert::Transfer::GuestfsStream;
+ sub new
+ {
+ my $class = shift;
+- my ($path) = @_;
++ my ($path, $format) = @_;
+
+ my $self = {};
+ bless($self, $class);
+
+- $self->{g} = new Sys::VirtConvert::GuestfsHandle([$path], undef, 0);
++ $self->{g} = new Sys::VirtConvert::GuestfsHandle([['sda', $path, $format]],
++ undef, 0);
+
+ return $self;
+ }
+diff --git a/p2v/server/virt-p2v-server.pl b/p2v/server/virt-p2v-server.pl
+index 8c52b08..7427055 100755
+--- a/p2v/server/virt-p2v-server.pl
++++ b/p2v/server/virt-p2v-server.pl
+@@ -343,8 +343,12 @@ sub convert
+ eval {
+ my $transferiso = $config->get_transfer_iso();
+
++ my @disks = map { [ $_->{device},
++ $_->{dst}->get_path(),
++ $_->{dst}->get_format() ] } @{$meta->{disks}};
++
+ $g = new Sys::VirtConvert::GuestfsHandle(
+- $meta->{disks},
++ \@disks,
+ $transferiso,
+ $target->isa('Sys::VirtConvert::Connection::RHEVTarget')
+ );
+diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl
+index dead384..b438766 100755
+--- a/v2v/virt-v2v.pl
++++ b/v2v/virt-v2v.pl
+@@ -518,8 +518,12 @@ v2vdie __('Guest doesn\'t define any storage devices')
+ $source->copy_storage($target, $output_format, $output_sparse);
+
+ # Open a libguestfs handle on the guest's storage devices
++my @disks = map { [ $_->{device},
++ $_->{dst}->get_path(),
++ $_->{dst}->get_format() ] } @{$meta->{disks}};
++
+ my $g = new Sys::VirtConvert::GuestfsHandle(
+- $meta->{disks},
++ \@disks,
+ $transferiso,
+ $output_method eq 'rhev'
+ );
More information about the scm-commits
mailing list