From: Roger Pau Monne Date: Fri, 4 Sep 2015 11:06:48 +0000 (+0200) Subject: xen/x86: allow disabling all emulated devices inside of Xen X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=bde21672a161a5cc379bab28a4d3cd3fa00de678;p=people%2Froyger%2Fxen.git xen/x86: allow disabling all emulated devices inside of Xen Only allow enabling or disabling all the emulated devices inside of Xen, right now Xen doesn't support enabling specific emulated devices only. Signed-off-by: Roger Pau Monné Reviewed-by: Andrew Cooper Cc: Jan Beulich Cc: Andrew Cooper --- Changes since v7: - Rework if condition. Changes since v5: - Add Andrew Cooper Reviewed-by. --- diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 3f9e5d22ce..971c88dc18 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -532,8 +532,8 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags, d->domain_id, config->emulation_flags); return -EINVAL; } - if ( is_hvm_domain(d) ? (config->emulation_flags != XEN_X86_EMU_ALL) - : (config->emulation_flags != 0) ) + if ( config->emulation_flags != 0 && + (!is_hvm_domain(d) || config->emulation_flags != XEN_X86_EMU_ALL) ) { printk(XENLOG_G_ERR "d%d: Xen does not allow %s domain creation " "with the current selection of emulators: %#x\n",