Add ppcle architectures to libvirt blockinfo

Instance evacuate would fail on hypervisor running with PPCLE or
PPC64LE architectures due to bus or device typewas set to IDE.
It would failed with 'IDE controllers are unsupported' error.
Update get_disk_bus_for_device_type to include support for PPCLE
and PPC64LE architecture to set bus or device type to scsi.

Closes-Bug: #1511539
Change-Id: Id65588321b3e3429b81a0bf4a4bac3899b38008f
(cherry picked from commit 9fd7e646e7)
This commit is contained in:
Christine Wang 2015-10-30 16:21:12 -05:00 committed by Matt Riedemann
parent 184e255249
commit 2a6c77ed6a
2 changed files with 6 additions and 1 deletions

View File

@ -678,6 +678,10 @@ class LibvirtBlockInfoTest(test.NoDBTestCase):
(arch.PPC, 'cdrom', 'scsi'),
(arch.PPC64, 'disk', 'virtio'),
(arch.PPC64, 'cdrom', 'scsi'),
(arch.PPCLE, 'disk', 'virtio'),
(arch.PPCLE, 'cdrom', 'scsi'),
(arch.PPC64LE, 'disk', 'virtio'),
(arch.PPC64LE, 'cdrom', 'scsi'),
(arch.S390, 'disk', 'virtio'),
(arch.S390, 'cdrom', 'scsi'),
(arch.S390X, 'disk', 'virtio'),

View File

@ -257,7 +257,8 @@ def get_disk_bus_for_device_type(instance,
elif virt_type in ("qemu", "kvm"):
if device_type == "cdrom":
guestarch = libvirt_utils.get_arch(image_meta)
if guestarch in (arch.PPC, arch.PPC64, arch.S390, arch.S390X):
if guestarch in (arch.PPC, arch.PPC64, arch.PPCLE, arch.PPC64LE,
arch.S390, arch.S390X):
return "scsi"
else:
return "ide"