(2.10) KVM: reserve a PCI slot for the SCSI controller
authorApollon Oikonomopoulos <apoikos@gmail.com>
Fri, 28 Mar 2014 18:29:17 +0000 (20:29 +0200)
committerDimitris Aragiorgis <dimara@grnet.gr>
Tue, 1 Apr 2014 11:11:51 +0000 (14:11 +0300)
Currently instances with disk_type=scsi are broken, because the SCSI
controller uses a PCI slot not accounted for in the PCI assignment
logic. We reserve a throw-away slot just for that.

This is a temporary workaround and will be reverted during the upcoming
refactoring.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

lib/hypervisor/hv_kvm.py

index b1e93da..c1bf74f 100644 (file)
@@ -1462,6 +1462,10 @@ class KVMHypervisor(hv_base.BaseHypervisor):
         _ = _GetFreeSlot(pci_reservations, reserve=True)
       kvm_cmd.extend(["-soundhw", soundhw])
 
+    if hvp[constants.HV_DISK_TYPE] == constants.HT_DISK_SCSI:
+      # The SCSI controller requires another PCI slot.
+      _ = _GetFreeSlot(pci_reservations, reserve=True)
+
     # Add id to ballon and place to the first available slot (3 or 4)
     addr = _GetFreeSlot(pci_reservations, reserve=True)
     pci_info = ",bus=pci.0,addr=%s" % hex(addr)