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@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
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,
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;
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:
{