]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen/x86: allow disabling all emulated devices inside of Xen
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 4 Sep 2015 11:06:48 +0000 (13:06 +0200)
committerRoger Pau Monne <roger.pau@citrix.com>
Wed, 4 Nov 2015 19:50:25 +0000 (20:50 +0100)
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é <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
Changes since v7:
 - Rework if condition.

Changes since v5:
 - Add Andrew Cooper Reviewed-by.

xen/arch/x86/domain.c

index 3f9e5d22cee9b9ec7f0618668091226089ce73eb..971c88dc18782cce7bc0ba43fe66da24e1d3118a 100644 (file)
@@ -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",