From: Keir Fraser Date: Wed, 19 May 2010 11:53:44 +0000 (+0100) Subject: xl: Check for dom0 when instructed to destroy a domain. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12116 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d015de71fe3c77b3d9d2586a22886b78c77c7b6e;p=xen.git xl: Check for dom0 when instructed to destroy a domain. Signed-off-by: Yang Hongyang --- diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index e6ce1d416d..4f03e8eb64 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1613,6 +1613,10 @@ void destroy_domain(char *p) { int rc; find_domain(p); + if (domid == 0) { + fprintf(stderr, "Cannot destroy privileged domain 0.\n\n"); + exit(-1); + } rc = libxl_domain_destroy(&ctx, domid, 0); if (rc) { fprintf(stderr,"destroy failed (rc=%d)\n.",rc); exit(-1); } }