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][ioemu-remote] fix pci-dettach issue

To: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Yuji Shimada <shimada-yxb@xxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH][ioemu-remote] fix pci-dettach issue
From: "Cui, Dexuan" <dexuan.cui@xxxxxxxxx>
Date: Fri, 6 Mar 2009 18:30:37 +0800
Accept-language: zh-CN, en-US
Acceptlanguage: zh-CN, en-US
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 06 Mar 2009 02:31:11 -0800
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcmeRpayhtg2UolSRx6AqL8YZTNuPA==
Thread-topic: [PATCH][ioemu-remote] fix pci-dettach issue
Commit 8c771eb6294afc5b3754a9e3de51568d4e5986c2 breaks guest PCI hotplug:
Before pt_config_delete() -> qemu_free_timer(ptdev->pm_state->pm_timer), we 
should invoke qemu_del_timer(), otherwise, qemu_run_timers() would access a 
qemu_free_timer()-ed timer.
The below patch fixes the issue.

Signed-off-by: Dexuan Cui <dexuan.cui@xxxxxxxxx>

---------------------------------------------------------------------------

diff --git a/hw/pass-through.c b/hw/pass-through.c
index 4a86309..22969c8 100644
--- a/hw/pass-through.c
+++ b/hw/pass-through.c
@@ -2034,6 +2034,7 @@ out:
     pm_state->flags &= ~PT_FLAG_TRANSITING;

     qemu_free_timer(pm_state->pm_timer);
+    pm_state->pm_timer = NULL;
 }

 void pt_default_power_transition(void *opaque)
@@ -2048,6 +2049,7 @@ void pt_default_power_transition(void *opaque)
     pm_state->flags &= ~PT_FLAG_TRANSITING;

     qemu_free_timer(pm_state->pm_timer);
+    pm_state->pm_timer = NULL;
 }

 /* initialize emulate register */
@@ -2181,7 +2183,11 @@ static void pt_config_delete(struct pt_dev *ptdev)
     if (ptdev->pm_state)
     {
         if (ptdev->pm_state->pm_timer)
+        {
+            qemu_del_timer(ptdev->pm_state->pm_timer);
             qemu_free_timer(ptdev->pm_state->pm_timer);
+            ptdev->pm_state->pm_timer = NULL;
+        }

         free(ptdev->pm_state);
     }
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH][ioemu-remote] fix pci-dettach issue, Cui, Dexuan <=