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 1/4 v2] ioemu: Register dpci_infos.php_devs.pt_dev in

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [patch 1/4 v2] ioemu: Register dpci_infos.php_devs.pt_dev in a common location
From: horms@xxxxxxxxxxxx
Date: Wed, 25 Mar 2009 14:32:03 +1100
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Delivery-date: Tue, 24 Mar 2009 20:47:48 -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>
References: <20090325033202.059806000@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: quilt/0.46-1
Currently power_on_php_slot() sets dpci_infos.php_devs[i].pt_dev itself
after the call to register_real_device(). While pt_init relies on
power_on_php_slot() to set this pointer.

It seems sensible to use the same behaviour for both callers.

There are no other callers of register_real_device()

Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>

--- 
* Sat, 21 Mar 2009 09:24:36 +1100
  Initial Public Release

* Wed, 25 Mar 2009 14:18:56 +1100
  Removed bogus second argument to PCI_SLOT()

Index: ioemu-remote/hw/pass-through.c
===================================================================
--- ioemu-remote.orig/hw/pass-through.c 2009-03-25 13:02:58.000000000 +1100
+++ ioemu-remote/hw/pass-through.c      2009-03-25 14:22:44.000000000 +1100
@@ -3644,7 +3644,7 @@ struct pt_dev * register_real_device(PCI
     struct pci_dev *pci_dev;
     uint8_t e_device, e_intx;
     struct pci_config_cf8 machine_bdf;
-    int free_slot = -1;
+    int free_slot;
     char *key, *val;
     int msi_translate, power_mgmt;
 
@@ -3732,8 +3732,7 @@ struct pt_dev * register_real_device(PCI
         return NULL;
     }
 
-    if ( free_slot > 0 )
-        dpci_infos.php_devs[free_slot].pt_dev = assigned_device;
+    dpci_infos.php_devs[PCI_SLOT(e_devfn)].pt_dev = assigned_device;
 
     assigned_device->pci_dev = pci_dev;
     assigned_device->msi_trans_cap = msi_translate;
@@ -3900,8 +3899,6 @@ int power_on_php_slot(int slot)
 
     php_dev->opt = NULL;
 
-    php_dev->pt_dev = pt_dev;
-
     return 0;
 
 }

-- 

-- 
Simon Horman
  VA Linux Systems Japan K.K., Sydney, Australia Satellite Office
  H: www.vergenet.net/~horms/             W: www.valinux.co.jp/en


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