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

[Xen-changelog] [xen master] domctl: do away with tool stack based retrying



commit 15e0aac6fe76be6a710a8e6d3da610d437903266
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Feb 18 16:57:02 2015 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Feb 18 16:57:02 2015 +0100

    domctl: do away with tool stack based retrying
    
    XEN_DOMCTL_destroydomain so far is being special cased in libxc to
    reinvoke the operation when getting back EAGAIN. Quite a few other
    domctl-s have gained continuations, so I see no reason not to use them
    here too.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/libxc/xc_domain.c |    6 +-----
 xen/common/domain.c     |    6 +-----
 xen/common/domctl.c     |    7 ++++---
 3 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index b864872..845d1d7 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -112,14 +112,10 @@ int xc_domain_unpause(xc_interface *xch,
 int xc_domain_destroy(xc_interface *xch,
                       uint32_t domid)
 {
-    int ret;
     DECLARE_DOMCTL;
     domctl.cmd = XEN_DOMCTL_destroydomain;
     domctl.domain = (domid_t)domid;
-    do {
-        ret = do_domctl(xch, &domctl);
-    } while ( ret && (errno == EAGAIN) );
-    return ret;
+    return do_domctl(xch, &domctl);
 }
 
 int xc_domain_shutdown(xc_interface *xch,
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0b05681..aa78fd7 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -617,13 +617,9 @@ int domain_kill(struct domain *d)
     case DOMDYING_dying:
         rc = domain_relinquish_resources(d);
         if ( rc != 0 )
-        {
-            if ( rc == -ERESTART )
-                rc = -EAGAIN;
             break;
-        }
         if ( cpupool_move_domain(d, cpupool0) )
-            return -EAGAIN;
+            return -ERESTART;
         for_each_vcpu ( d, v )
             unmap_vcpu_info(v);
         d->is_dying = DOMDYING_dead;
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 33ecd45..4a42c66 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -692,10 +692,11 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
u_domctl)
     break;
 
     case XEN_DOMCTL_destroydomain:
-    {
         ret = domain_kill(d);
-    }
-    break;
+        if ( ret == -ERESTART )
+            ret = hypercall_create_continuation(
+                __HYPERVISOR_domctl, "h", u_domctl);
+        break;
 
     case XEN_DOMCTL_setnodeaffinity:
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.