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, pci passthru: Relax the requirement

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend, pci passthru: Relax the requirement of co-assignment.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 28 Jul 2008 08:10:16 -0700
Delivery-date: Mon, 28 Jul 2008 08:10:40 -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 1217240925 -3600
# Node ID c6502ade05f9b23be51a4bf9f3f4111e85bee7b3
# Parent  6783e2ec60c0793d1ed78d1fe3a63381c019e06a
xend, pci passthru: Relax the requirement of co-assignment.

Certain PCI or PCIe devices needs to be co-assigned. Currently we
require all the related devices be assigned to the same guest. This
can be relaxed to: part of them can be assgined to the same guest, and
after that, the left ones can't be assigned.

Signed-off-by: Dexuan Cui <dexuan.cui@xxxxxxxxx>
---
 tools/python/xen/util/pci.py          |    2 +-
 tools/python/xen/xend/server/pciif.py |   20 ++++++++++++++++----
 2 files changed, 17 insertions(+), 5 deletions(-)

diff -r 6783e2ec60c0 -r c6502ade05f9 tools/python/xen/util/pci.py
--- a/tools/python/xen/util/pci.py      Mon Jul 28 11:27:48 2008 +0100
+++ b/tools/python/xen/util/pci.py      Mon Jul 28 11:28:45 2008 +0100
@@ -105,7 +105,7 @@ def parse_hex(val):
         return None
 
 def parse_pci_name(pci_name_string):
-    # Format: xxxx:xx:xx:x
+    # Format: xxxx:xx:xx.x
     s = pci_name_string
     s = s.split(':')
     dom = parse_hex(s[0])
diff -r 6783e2ec60c0 -r c6502ade05f9 tools/python/xen/xend/server/pciif.py
--- a/tools/python/xen/xend/server/pciif.py     Mon Jul 28 11:27:48 2008 +0100
+++ b/tools/python/xen/xend/server/pciif.py     Mon Jul 28 11:28:45 2008 +0100
@@ -378,8 +378,14 @@ class PciController(DevController):
                 funcs = dev.find_all_the_multi_functions()
                 for f in funcs:
                     if not f in pci_str_list:
-                        err_msg = 'pci: % must be co-assigned to guest with %s'
-                        raise VmError(err_msg % (f, dev.name))
+                        (f_dom, f_bus, f_slot, f_func) = parse_pci_name(f)
+                        f_pci_str = '0x%x,0x%x,0x%x,0x%x' % \
+                            (f_dom, f_bus, f_slot, f_func)
+                        # f has been assigned to other guest?
+                        if xc.test_assign_device(0, f_pci_str) != 0:
+                            err_msg = 'pci: %s must be co-assigned to the' + \
+                                ' same guest with %s'
+                            raise VmError(err_msg % (f, dev.name))
             elif dev.dev_type == DEV_TYPE_PCI:
                 if dev.bus == 0:
                     if not dev.pci_af_flr:
@@ -395,8 +401,14 @@ class PciController(DevController):
 
                     for s in devs_str:
                         if not s in pci_str_list:
-                            err_msg = 'pci: %s must be co-assigned to guest 
with %s'
-                            raise VmError(err_msg % (s, dev.name))
+                            (s_dom, s_bus, s_slot, s_func) = parse_pci_name(s)
+                            s_pci_str = '0x%x,0x%x,0x%x,0x%x' % \
+                                (s_dom, s_bus, s_slot, s_func)
+                            # s has been assigned to other guest?
+                            if xc.test_assign_device(0, s_pci_str) != 0:
+                                err_msg = 'pci: %s must be co-assigned to 
the'+\
+                                    ' same guest with %s'
+                                raise VmError(err_msg % (s, dev.name))
 
         for (domain, bus, slot, func) in pci_dev_list:
             self.setupOneDevice(domain, bus, slot, func)

_______________________________________________
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, pci passthru: Relax the requirement of co-assignment., Xen patchbot-unstable <=