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

Re: [Xen-devel] [PATCH 7/7] tools/libxl: Allow dom0 to be destroyed



On Tue, 2014-03-18 at 17:34 -0400, Daniel De Graaf wrote:
> @@ -3076,12 +3076,13 @@ static void unpause_domain(uint32_t domid)
>      libxl_domain_unpause(ctx, domid);
>  }
>  
> -static void destroy_domain(uint32_t domid)
> +static void destroy_domain(uint32_t domid, int force)
>  {
>      int rc;
>  
> -    if (domid == 0) {
> -        fprintf(stderr, "Cannot destroy privileged domain 0.\n\n");
> +    if (domid == 0 && !force) {
> +        fprintf(stderr, "Destroying domain 0 is only supported in a"
> +                " disaggregated environment and requires the -f flag.\n\n");

From a user point of view perhaps this would be clearer if worded
something like:

        Not destroying domain 0, use -f to force.

Is the error message on attempted self destruction informative? If not
then append "This can only be done from another domain, e.g. a
disaggregated toolstack domain".

Last random thought: Does this code know or have the potential to know
which domain it is running in?

All of this info should also be added to the man page and the help text
in xl_cmdtable.c needs to have the -f added to it.

>          exit(-1);
>      }
>      rc = libxl_domain_destroy(ctx, domid, 0);
> @@ -4166,12 +4167,15 @@ int main_unpause(int argc, char **argv)
>  int main_destroy(int argc, char **argv)
>  {
>      int opt;
> +    int force = 0;
>  
> -    SWITCH_FOREACH_OPT(opt, "", NULL, "destroy", 1) {
> -        /* No options */
> +    SWITCH_FOREACH_OPT(opt, "f", NULL, "destroy", 1) {
> +    case 'f':
> +        force = 1;
> +        break;
>      }
>  
> -    destroy_domain(find_domain(argv[optind]));
> +    destroy_domain(find_domain(argv[optind]), force);
>      return 0;
>  }
>  



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.