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] tools/xl: fix race which can leave an xl monitor

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] tools/xl: fix race which can leave an xl monitor
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Thu, 16 Dec 2010 17:45:54 +0000
Delivery-date: Thu, 16 Dec 2010 09:46:37 -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
The patch below, which I have just applied, deals with a race during
"xl destroy" which can leave an xl process waiting.

While I was preparing this patch I noticed that the surrounding code
had a number of deficiencies, which I note down here for us to do
something about:
 * The "libxl_event_get_*" functions take a domid, when they should
   _return_ the domid of the affected domain.  The library's caller
   may be managing multiple domains.
 * The "libxl_event_get_*" functions do not actually look at the
   event (!) but rather get the information from somewhere else.  This
   means that there can be races where the event has a particular type
   but the information obtained by the getter function does not
   correspond at all.
 * libxl_domain_info provides no way for the caller to recognise "this
   domain no longer exists".  I would suggest a new flag bit
   "nodomain" in libxl_dominfo.  Consequentially
   libxl_event_get_domain_death_info ignores error returns from
   libxl_domain_info.

Ian.

# HG changeset patch
# User Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
# Date 1292521164 0
# Node ID 1800f15da48a81d63635ceb6ca77dacbf50dc303
# Parent  4b92c5ea284a26250c574235cc649ed3b2f6fbf6
tools/xl: fix race which can leave an xl monitor processing hanging

If the domain is destroyed (eg with xl destroy), it is possible that
the xl which is monitoring the domain for restart/preserve will not be
able to get the domain shutdown reason.

Before this patch, it would then ignore the domain death event and
carry on waiting, forever, for more events.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

diff -r 4b92c5ea284a -r 1800f15da48a tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Thu Dec 16 16:58:39 2010 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Thu Dec 16 17:39:24 2010 +0000
@@ -1848,6 +1848,9 @@ start:
                         ret = 0;
                         goto out;
                     }
+                } else {
+                    LOG("Unable to get domain death info, quitting");
+                    goto out;
                 }
                 break;
             case LIBXL_EVENT_DISK_EJECT:

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] tools/xl: fix race which can leave an xl monitor, Ian Jackson <=