[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86: adds put_domain() for breaks in arch_do_domctl().



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1216975661 -3600
# Node ID 9b8f3ec6c5fde0391a3b2128d63b8c988429da80
# Parent  630ee9fd6f8c03fe813abab0cb47db7982b566c8
x86: adds put_domain() for breaks in arch_do_domctl().

Signed-off-by: Weidong Han <weidong.han@xxxxxxxxx>
---
 xen/arch/x86/domctl.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff -r 630ee9fd6f8c -r 9b8f3ec6c5fd xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c     Fri Jul 25 09:46:27 2008 +0100
+++ b/xen/arch/x86/domctl.c     Fri Jul 25 09:47:41 2008 +0100
@@ -661,6 +661,7 @@ long arch_do_domctl(
         if ( !iommu_pv_enabled && !is_hvm_domain(d) )
         {
             ret = -ENOSYS;
+            put_domain(d);
             break;
         }
 
@@ -669,12 +670,16 @@ long arch_do_domctl(
             gdprintk(XENLOG_ERR, "XEN_DOMCTL_assign_device: "
                      "%x:%x:%x already assigned, or non-existent\n",
                      bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
+            put_domain(d);
             break;
         }
 
         ret = assign_device(d, bus, devfn);
-        gdprintk(XENLOG_INFO, "XEN_DOMCTL_assign_device: bdf = %x:%x:%x\n",
-                 bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
+        if ( ret )
+            gdprintk(XENLOG_ERR, "XEN_DOMCTL_assign_device: "
+                     "assign device (%x:%x:%x) failed\n",
+                     bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
+
         put_domain(d);
     }
     break;
@@ -701,11 +706,15 @@ long arch_do_domctl(
         if ( !iommu_pv_enabled && !is_hvm_domain(d) )
         {
             ret = -ENOSYS;
+            put_domain(d);
             break;
         }
 
         if ( !device_assigned(bus, devfn) )
-            break;
+        {
+            put_domain(d);
+            break;
+        }
 
         ret = 0;
         deassign_device(d, bus, devfn);

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.