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

Re: [Xen-devel] [PATCH v6 11/29] xen/x86: add bitmap of enabled emulated devices



>>> On 23.09.15 at 14:35, <roger.pau@xxxxxxxxxx> wrote:
> El 16/09/15 a les 11.50, Jan Beulich ha escrit:
>>>>> On 04.09.15 at 14:08, <roger.pau@xxxxxxxxxx> wrote:
>>> +                   d->domain_id, config->emulation_flags);
>>> +            return -EINVAL;
>>> +        }
>>> +        if ( config->emulation_flags != emulation_mask )
>>> +        {
>>> +            printk(XENLOG_G_ERR "d%d: Xen does not allow HVM creation with 
>>> the "
>>> +                   "current selection of emulators: %#x.\n", d->domain_id,
>>> +                   config->emulation_flags);
>>> +            return -EOPNOTSUPP;
>>> +        }
>>> +        d->arch.emulation_flags = config->emulation_flags;
>>> +    }
>> 
>> Isn't there an "else" missing here, validating that the flags are zero?
> 
> The comment in xen/include/asm-x86/domain.h above the emulation_flags
> field already mentions that this field is ignored for PV guests. For
> example the x86 Dom0 building code calls arch_domain_create passing in a
> NULL xen_arch_domainconfig, so I think it's easier to just ignore this
> for PV guests.

Easier now, but perhaps more cumbersome if we ever want to
assign that field some meaning for PV. It's a domctl, so not _that_
difficult to change, but you may have noticed that I generally ask
for unused fields/bits to be validated to be zero, to allow using
them later on. Anyway - not a big issue, I just wanted to point it
out (and I might stumble across the missing else again during
review of future revisions).

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®.