[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH] RHEV: Only mark the first disk as bootable



RHEV will fail to start a guest with more than one VirtIO disk marked as
bootable. The previous behaviour of V2V simply marked all disks as bootable,
intending to follow the behaviour of libvirt's qemu driver. However, libvirt's
qemu driver actually only marks the first disk specified in the domain XML
(which may or may not be Xda) as bootable. This change updates the RHEV output
to follow this.

Fixes RHBZ#595619
---
 lib/Sys/VirtV2V/Target/RHEV.pm |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/Sys/VirtV2V/Target/RHEV.pm b/lib/Sys/VirtV2V/Target/RHEV.pm
index c35379d..231fe5c 100644
--- a/lib/Sys/VirtV2V/Target/RHEV.pm
+++ b/lib/Sys/VirtV2V/Target/RHEV.pm
@@ -874,8 +874,9 @@ sub _disks
         $diske->setAttribute('ovf:format', 'http://en.wikipedia.org/wiki/Byte');
         # IDE = 0, SCSI = 1, VirtIO = 2
         $diske->setAttribute('ovf:disk-interface', $bus eq 'virtio' ? 2 : 0);
-        # The libvirt QEMU driver marks all disks as bootable
-        $diske->setAttribute('ovf:boot', 'True');
+        # The libvirt QEMU driver marks the first disk (in document order) as
+        # bootable
+        $diske->setAttribute('ovf:boot', $driveno == 1 ? 'True' : 'False');
 
         # Add disk to VirtualHardware
         my $item = $ovf->createElement('Item');
-- 
1.7.0.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]