Matthew Booth
2010-May-26 15:53 UTC
[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
Richard W.M. Jones
2010-May-26 18:40 UTC
[Libguestfs] [PATCH] RHEV: Only mark the first disk as bootable
On Wed, May 26, 2010 at 04:53:06PM +0100, Matthew Booth wrote:> 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');ACK, obvious fix. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top
Seemingly Similar Threads
- [PATCH 1/2] Refactor guest and volume creation into Sys::VirtV2V::Target::LibVirt
- [PATCH 1/2] Allow reading more data than the reported size of a volume
- [PATCH] Converter: Prefer detected arch of OS if it's available
- [PATCH] Remove v2v-snapshot
- [PATCH] Improve error message when LibvirtXML is given invalid domain XML