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] qemu-xen: pass-through: non-idempotent __insert_to_p

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [patch] qemu-xen: pass-through: non-idempotent __insert_to_pci_slot()
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Mon, 1 Jun 2009 13:10:39 +1000
Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>, Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>, Edwin Zhai <edwin.zhai@xxxxxxxxx>
Delivery-date: Sun, 31 May 2009 20:11:13 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20090529065640.GA19665@xxxxxxxxxxxx>
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>
References: <20090529065640.GA19665@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
As of "qemu-xen: hot-plug PCI devices at boot-time" register_real_dev()
no longer needs to call __insert_to_pci_slot() and thus there
is no need for __insert_to_pci_slot() to be idempotent.

This is because register_real_dev()'s now only has one caller,
power_on_php_slot(), which always  passes a valid e_slot to
register_real_dev().

Cc: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
Cc: Edwin Zhai <edwin.zhai@xxxxxxxxx>
Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>

--- 

This patch requires "qemu-xen: hot-plug PCI devices at boot-time"

Index: ioemu-remote/hw/pass-through.c
===================================================================
--- ioemu-remote.orig/hw/pass-through.c 2009-06-01 12:49:24.000000000 +1000
+++ ioemu-remote/hw/pass-through.c      2009-06-01 13:02:24.000000000 +1000
@@ -914,9 +914,6 @@ static int __insert_to_pci_slot(int bus,
         if ( !test_pci_slot(slot) &&
              !pci_devfn_in_use(e_bus, PCI_DEVFN(slot, 0)) )
             goto found;
-        if ( pci_slot_match(bus, dev, func, slot) )
-            /* The slot is already here, just return */
-            return slot;
         return -2;
     }
 
@@ -3778,12 +3775,6 @@ static struct pt_dev * register_real_dev
     pci_fill_info(pci_dev, PCI_FILL_IRQ | PCI_FILL_BASES | PCI_FILL_ROM_BASE | 
PCI_FILL_SIZES);
     pt_libpci_fixup(pci_dev);
 
-    e_slot = __insert_to_pci_slot(r_bus, r_dev, r_func, e_slot, NULL);
-    if ( e_slot < 0 ) {
-        PT_LOG("Error: no free virtual PCI slot\n");
-        return NULL;
-    }
-
     msi_translate = direct_pci_msitranslate;
     power_mgmt = direct_pci_power_mgmt;
     while (opt) {

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