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-devel

[Xen-devel] [PATCH 5 of 7] xend: allow a device to be assigned to a gues

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 5 of 7] xend: allow a device to be assigned to a guest and its stubdom
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Mon, 12 Oct 2009 18:20:41 +0100
Delivery-date: Mon, 12 Oct 2009 10:23:27 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
This patch allows a pci device to be passed through an HVM guest and its
own stubdom at the same time.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

---

diff -r 3fe128b5f387 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Thu Oct 08 12:14:19 2009 +0100
+++ b/tools/python/xen/xend/XendConfig.py       Fri Oct 09 19:30:38 2009 +0100
@@ -2061,6 +2061,9 @@
     def is_hvm(self):
         return self['HVM_boot_policy'] != ''
 
+    def is_stubdom(self):
+        return (self['PV_kernel'].find('ioemu') >= 0)
+
     def target(self):
         return self['target']
 
diff -r 3fe128b5f387 tools/python/xen/xend/server/pciif.py
--- a/tools/python/xen/xend/server/pciif.py     Thu Oct 08 12:14:19 2009 +0100
+++ b/tools/python/xen/xend/server/pciif.py     Fri Oct 09 19:30:38 2009 +0100
@@ -77,7 +77,8 @@
     dom_list = xstransact.List('/local/domain')
     pci_str_list = []
     for d in dom_list:
-        pci_str_list = pci_str_list + get_assigned_pci_devices(int(d))
+        if xstransact.Read('/local/domain/' + d + '/target') is None :
+            pci_str_list = pci_str_list + get_assigned_pci_devices(int(d))
     return pci_str_list
 
 class PciController(DevController):
@@ -303,7 +304,7 @@
         if dev.driver == 'pciback':
             PCIQuirk(dev)
 
-        if not self.vm.info.is_hvm():
+        if not self.vm.info.is_hvm() and not self.vm.info.is_stubdom() :
             # Setup IOMMU device assignment
             bdf = xc.assign_device(fe_domid, pci_dict_to_xc_str(pci_dev))
             pci_str = pci_dict_to_bdf_str(pci_dev)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 5 of 7] xend: allow a device to be assigned to a guest and its stubdom, Stefano Stabellini <=