WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xend: Dis-allow device assignment if PoD

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: Dis-allow device assignment if PoD is enabled.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Jan 2010 07:15:13 -0800
Delivery-date: Thu, 21 Jan 2010 07:15:13 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1264084805 0
# Node ID d1efaaee441bb7b5dd1d05fd07e48fd81c05a374
# Parent  cec57fd4565efd45332440226709182be4336216
xend: Dis-allow device assignment if PoD is enabled.

Signed-off-by: Dongxiao Xu <dongxiao.xu@xxxxxxxxx>
---
 tools/python/xen/xend/XendDomainInfo.py |   17 +++++++++++++++++
 1 files changed, 17 insertions(+)

diff -r cec57fd4565e -r d1efaaee441b tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Thu Jan 21 11:27:11 2010 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Thu Jan 21 14:40:05 2010 +0000
@@ -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)
 
@@ -707,6 +722,8 @@ class XendDomainInfo:
         check if the device can be attached to guest or not; if yes, we do_FLR
         the device.
         """
+
+        self.iommu_check_pod_mode()
 
         # Test whether the devices can be assigned
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: Dis-allow device assignment if PoD is enabled., Xen patchbot-unstable <=