[Libguestfs] [PATCH 3/6] Use add_drive instead of add_cdrom for transfer iso image

Matthew Booth mbooth at redhat.com
Tue Feb 9 16:01:16 UTC 2010


There's a current bug in libguestfs which means the order of devices returned by
list-devices is unpredictable if there are a mix of drive types. Presenting the
transfer iso as a hard disk rather than a cdrom drive works fine, and works
around this issue.
---
 v2v/virt-v2v.pl |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl
index ee2210f..cf78523 100755
--- a/v2v/virt-v2v.pl
+++ b/v2v/virt-v2v.pl
@@ -350,9 +350,8 @@ sub get_guestfs_handle
 {
     my $g = open_guest(\@_, rw => 1);
 
-    # Mount the transfer iso if GuestOS needs it
-    my $transferiso = Sys::VirtV2V::GuestOS->get_transfer_iso();
-    $g->add_cdrom($transferiso) if(defined($transferiso));
+    # Add the transfer iso if there is one
+    $g->add_drive($transferiso) if(defined($transferiso));
 
     # Enable selinux in the guest
     $g->set_selinux(1);
-- 
1.6.6




More information about the Libguestfs mailing list