xl: Check dom0 on command level when destroy domains
PATCH 1/1 xl: Check dom0 on command level when destroy domains
Check dom0 on command level when destroy domains.
Signed-off-by Yang Hongyang<[email protected]>
tools/libxl/xl_cmdimpl.c +4 -0
@@ -1568,6 +1568,10 @@ {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 ); } }
Signature · 2 lines
Regards Yang Hongyang