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 --- 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, --- 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; --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -692,10 +692,11 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe 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: {