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/
Home Products Support Community News


Re: [Xen-devel] [PATCH] Make XEN_DOMCTL_destroydomain hypercall return e

To: Keir Fraser <keir@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Make XEN_DOMCTL_destroydomain hypercall return error
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Thu, 9 Aug 2007 19:09:42 +0900
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 09 Aug 2007 03:07:15 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C2E0A25F.13DCD%keir@xxxxxxxxxxxxx>
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>
References: <20070809081831.GA23813%yamahata@xxxxxxxxxxxxx> <C2E0A25F.13DCD%keir@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/
On Thu, Aug 09, 2007 at 10:52:14AM +0100, Keir Fraser wrote:
> Attached is a cleaned-up version of your patch. One change is that
> getdomaininfo does not return 'dying' until domain_kill() is fully
> completed. This will prevent tools from not retrying domain_kill() because
> it looks like it's already been executed!

Thank you for reviewing.
test_and_set_bool(d->is_dying) is used to avoid race, isn't it?
But the updated patch drops it so that it would be racy. 

> One thing is still missing though -- where do you intend to put the retry
> loop in the toolstack?

I inserted it to privcmd driver at first.
But it would be appropriate to insert the logic to xc_domain_destroy()
of libxc.
Which do you prefer?

# HG changeset patch
# User yamahata@xxxxxxxxxxxxx
# Date 1186653836 -32400
# Node ID 9efffe2118469a6e9964ffd0e757d4df3d1e1a7b
# Parent  68e21f17cfeb09f898eb38df14234469895b8181
retry destroy domain hypercall until success.
PATCHNAME: retry_destroy_domain_hypercall_until_success

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r 68e21f17cfeb -r 9efffe211846 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c   Thu Aug 09 16:19:18 2007 +0900
+++ b/tools/libxc/xc_domain.c   Thu Aug 09 19:03:56 2007 +0900
@@ -55,10 +55,14 @@ int xc_domain_destroy(int xc_handle,
 int xc_domain_destroy(int xc_handle,
                       uint32_t domid)
+    int ret;
     domctl.cmd = XEN_DOMCTL_destroydomain;
     domctl.domain = (domid_t)domid;
-    return do_domctl(xc_handle, &domctl);
+    do {
+        ret = do_domctl(xc_handle, &domctl);
+    } while (ret == -EAGAIN);
+    return ret;
 int xc_domain_shutdown(int xc_handle,


Xen-devel mailing list