Index: xen-4.4.0-testing/tools/libxl/xl.c =================================================================== --- xen-4.4.0-testing.orig/tools/libxl/xl.c +++ xen-4.4.0-testing/tools/libxl/xl.c @@ -282,6 +282,32 @@ static void xl_ctx_free(void) } } +/* + Return 0 if domain is managed by libvirt +*/ +static int xl_lookup_libvirt_managed_domain(int argc, char **argv) +{ + uint32_t domid; + uint8_t *t_data; + char *domname; + int i, rc, t_len; + + for (i=0; imodifies && !dryrun_only) { + if (!force_execution) { + if (!xl_lookup_libvirt_managed_domain(argc, argv)) { + fprintf(stderr, +"Warning: This domain is managed by libvirt. Using xl commands to modify this\n" +"domain will result in errors when virsh or virt-manager is used.\n" +"Please use only virsh or virt-manager to manage this domain.\n\n" +"(This check can be overridden with the -f option.)\n" + ); + ret = 1; + goto xit; + } + } for (int i = 0; i < sizeof(locks)/sizeof(locks[0]); i++) { if (!access(locks[i], F_OK) && !force_execution) { fprintf(stderr,