xen-org/xen-api — pull request #994 by robhoes (2013-02-01 11:41:04+00:00)
Title: CA-96886: Fix race for a PCI device by multiple starting VMs

When multiple simultaneously starting VMs try to grab the same PCI device, only one of them may get it, and the others must fail to start. However, xapi considers a PCI device "assigned" to a VM only when the VM has started and the device has been made available to the VM, which is some time after xapi has asked xenopsd to start the VM and give it the PCI device. This means that there is a window during which multiple VM may be given the same device.

This patch attempts to resolve this by temporarily reserving a PCI device for a VM in xapi, before telling xenopsd to start the VM.

Signed-off-by: Rob Hoes