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: allow a device to be assigned to a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: allow a device to be assigned to a guest and its stubdom
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Oct 2009 01:15:16 -0700
Delivery-date: Wed, 14 Oct 2009 01:15:48 -0700
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 1255506985 -3600
# Node ID 8194e594f8df0ac0c4a7bf8ffc950d25177a24b4
# Parent  a95b55bf6c1a38b2912e2c5cbc5d2a5cd460b9e4
xend: allow a device to be assigned to a guest and its stubdom

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>
---
 tools/python/xen/xend/XendConfig.py   |    3 +++
 tools/python/xen/xend/server/pciif.py |    5 +++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff -r a95b55bf6c1a -r 8194e594f8df tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Wed Oct 14 08:55:43 2009 +0100
+++ b/tools/python/xen/xend/XendConfig.py       Wed Oct 14 08:56:25 2009 +0100
@@ -2063,6 +2063,9 @@ class XendConfig(dict):
     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 a95b55bf6c1a -r 8194e594f8df tools/python/xen/xend/server/pciif.py
--- a/tools/python/xen/xend/server/pciif.py     Wed Oct 14 08:55:43 2009 +0100
+++ b/tools/python/xen/xend/server/pciif.py     Wed Oct 14 08:56:25 2009 +0100
@@ -77,7 +77,8 @@ def get_all_assigned_pci_devices():
     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 @@ class PciController(DevController):
         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-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: allow a device to be assigned to a guest and its stubdom, Xen patchbot-unstable <=