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] fix xenconsoled race

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] fix xenconsoled race
From: John Levon <levon@xxxxxxxxxxxxxxxxx>
Date: Wed, 13 Sep 2006 03:19:08 +0100
Delivery-date: Tue, 12 Sep 2006 19:19:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
# HG changeset patch
# User max.zhen@xxxxxxx
# Node ID db465ecb164e6d89290ae3d4fcc029e29305ae7d
# Parent  c682ae7a17224dc5576ba3c5db47766b2a7dc159
Shouldn't call domain_create_ring() for a domU which is shutting down.
There is a race condition between domain_create_ring() and the removal of the do
mU entry from xenstore. If the removal of the domU entry from xenstore comes lat
er than the first xs_gather() call in domain_create_ring(), it will go on and bi
nd the evtchn port to the dying domU, which will cause below error message:
(XEN) (file=event_channel.c, line=144) EVTCHNOP failure: domain 0, error -22, li
ne 144

Signed-off-by: Max Zhen <max.zhen@xxxxxxx>

diff -r c682ae7a1722 -r db465ecb164e tools/console/daemon/io.c
--- a/tools/console/daemon/io.c Fri Sep 01 12:16:21 2006 +0100
+++ b/tools/console/daemon/io.c Fri Sep 01 08:14:07 2006 -0700
@@ -293,12 +293,14 @@ static bool watch_domain(struct domain *
        bool success;
 
        sprintf(domid_str, "dom%u", dom->domid);
-       if (watch)
+       if (watch) {
                success = xs_watch(xs, dom->conspath, domid_str);
-       else
+               if (success)
+                       domain_create_ring(dom);
+       } else {
                success = xs_unwatch(xs, dom->conspath, domid_str);
-       if (success)
-               domain_create_ring(dom);
+       }
+
        return success;
 }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] fix xenconsoled race, John Levon <=