mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
xend: Dis-allow device assignment if PoD is enabled.
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
This commit is contained in:
1 parent
b304702a73
commit
ec78952374
1 file changed
+17
@@ -390,6 +390,14 @@ class XendDomainInfo:
|
||||
self.domid = domid
|
||||
self.guest_bitsize = None
|
||||
self.alloc_mem = None
|
||||
|
||||
maxmem = self.info.get('memory_static_max', 0)
|
||||
memory = self.info.get('memory_dynamic_max', 0)
|
||||
|
||||
if maxmem > memory:
|
||||
self.pod_enabled = True
|
||||
else:
|
||||
self.pod_enabled = False
|
||||
|
||||
#REMOVE: uuid is now generated in XendConfig
|
||||
#if not self._infoIsSet('uuid'):
|
||||
@@ -694,11 +702,18 @@ class XendDomainInfo:
|
||||
|
||||
return self.hvm_pci_device_insert_dev(new_dev)
|
||||
|
||||
def iommu_check_pod_mode(self):
|
||||
""" Disallow PCI device assignment if pod is enabled. """
|
||||
if self.pod_enabled:
|
||||
raise VmError("failed to assign device since pod is enabled")
|
||||
|
||||
def pci_dev_check_assignability_and_do_FLR(self, config):
|
||||
""" In the case of static device assignment(i.e., the 'pci' string in
|
||||
guest config file), we check if the device(s) specified in the 'pci'
|
||||
can be assigned to guest or not; if yes, we do_FLR the device(s).
|
||||
"""
|
||||
|
||||
self.iommu_check_pod_mode()
|
||||
pci_dev_ctrl = self.getDeviceController('pci')
|
||||
return pci_dev_ctrl.dev_check_assignability_and_do_FLR(config)
|
||||
|
||||
@@ -708,6 +723,8 @@ class XendDomainInfo:
|
||||
the device.
|
||||
"""
|
||||
|
||||
self.iommu_check_pod_mode()
|
||||
|
||||
# Test whether the devices can be assigned
|
||||
|
||||
pci_name = pci_dict_to_bdf_str(new_dev)
|
||||
|
||||