[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v7 24/32] xen/x86: allow disabling all emulated devices inside of Xen



>>> On 02.10.15 at 17:48, <roger.pau@xxxxxxxxxx> wrote:
> 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@xxxxxxxxxx>
> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Cc: Jan Beulich <jbeulich@xxxxxxxx>
> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> Changes since v5:
>  - Add Andrew Cooper Reviewed-by.
> ---
>  xen/arch/x86/domain.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
> index 79182a4..a3b1c9b 100644
> --- a/xen/arch/x86/domain.c
> +++ b/xen/arch/x86/domain.c
> @@ -526,7 +526,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) ||
> +    if ( (is_hvm_domain(d) && config->emulation_flags != XEN_X86_EMU_ALL &&
> +         config->emulation_flags != 0) ||
>           (is_pv_domain(d) && config->emulation_flags != 0) )

Would there be any bad in simplifying this to

    if ( config->emulation_flags != 0 && (!is_hvm_domain(d) || 
config->emulation_flags != XEN_X86_EMU_ALL) )

(i.e. allowing flags to be zero for all kinds)?

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.