* Shall we clear the cpumap in XEN_DOMCTL_setvcpuaffinity
@ 2010-05-12 7:22 Jiang, Yunhong
2010-05-12 7:43 ` Keir Fraser
0 siblings, 1 reply; 4+ messages in thread
From: Jiang, Yunhong @ 2010-05-12 7:22 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel@lists.xensource.com
When browse code, I noticed if the op->u.vcpuaffinity.cpumap is NULL, a random value of new_affinity will be passed to vcpu_set_affinity(), as in followed code.
I'm not sure if this is expected result. IMO, we should return -EINVAL if no cpu specified, as the return value at vcpu_set_affinity() for empty cpumap.
Did I missed anything?
case XEN_DOMCTL_getvcpuaffinity:
{
domid_t dom = op->domain;
struct domain *d = rcu_lock_domain_by_id(dom);
struct vcpu *v;
cpumask_t new_affinity;
......
if ( op->cmd == XEN_DOMCTL_setvcpuaffinity )
{
xenctl_cpumap_to_cpumask( >>>>> the new_affinity is not initialized for if cpumap==NULL
&new_affinity, &op->u.vcpuaffinity.cpumap);
ret = vcpu_set_affinity(v, &new_affinity);
}
Thanks
--jyh
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Shall we clear the cpumap in XEN_DOMCTL_setvcpuaffinity
2010-05-12 7:22 Shall we clear the cpumap in XEN_DOMCTL_setvcpuaffinity Jiang, Yunhong
@ 2010-05-12 7:43 ` Keir Fraser
2010-05-12 7:57 ` Jiang, Yunhong
0 siblings, 1 reply; 4+ messages in thread
From: Keir Fraser @ 2010-05-12 7:43 UTC (permalink / raw)
To: Jiang, Yunhong; +Cc: xen-devel@lists.xensource.com
On 12/05/2010 08:22, "Jiang, Yunhong" <yunhong.jiang@intel.com> wrote:
> When browse code, I noticed if the op->u.vcpuaffinity.cpumap is NULL, a random
> value of new_affinity will be passed to vcpu_set_affinity(), as in followed
> code.
>
> I'm not sure if this is expected result. IMO, we should return -EINVAL if no
> cpu specified, as the return value at vcpu_set_affinity() for empty cpumap.
Xen-unstable:21350.
Thanks,
Keir
> Did I missed anything?
>
> case XEN_DOMCTL_getvcpuaffinity:
> {
> domid_t dom = op->domain;
> struct domain *d = rcu_lock_domain_by_id(dom);
> struct vcpu *v;
> cpumask_t new_affinity;
> ......
> if ( op->cmd == XEN_DOMCTL_setvcpuaffinity )
> {
> xenctl_cpumap_to_cpumask( >>>>> the new_affinity is not
> initialized for if cpumap==NULL
> &new_affinity, &op->u.vcpuaffinity.cpumap);
> ret = vcpu_set_affinity(v, &new_affinity);
> }
>
> Thanks
> --jyh
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Shall we clear the cpumap in XEN_DOMCTL_setvcpuaffinity
2010-05-12 7:43 ` Keir Fraser
@ 2010-05-12 7:57 ` Jiang, Yunhong
2010-05-12 8:11 ` Keir Fraser
0 siblings, 1 reply; 4+ messages in thread
From: Jiang, Yunhong @ 2010-05-12 7:57 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel@lists.xensource.com
Thanks, although "no changes found" after hg pull :-)
--jyh
>-----Original Message-----
>From: Keir Fraser [mailto:keir.fraser@eu.citrix.com]
>Sent: Wednesday, May 12, 2010 3:43 PM
>To: Jiang, Yunhong
>Cc: xen-devel@lists.xensource.com
>Subject: Re: Shall we clear the cpumap in XEN_DOMCTL_setvcpuaffinity
>
>On 12/05/2010 08:22, "Jiang, Yunhong" <yunhong.jiang@intel.com> wrote:
>
>> When browse code, I noticed if the op->u.vcpuaffinity.cpumap is NULL, a random
>> value of new_affinity will be passed to vcpu_set_affinity(), as in followed
>> code.
>>
>> I'm not sure if this is expected result. IMO, we should return -EINVAL if no
>> cpu specified, as the return value at vcpu_set_affinity() for empty cpumap.
>
>Xen-unstable:21350.
>
> Thanks,
> Keir
>
>> Did I missed anything?
>>
>> case XEN_DOMCTL_getvcpuaffinity:
>> {
>> domid_t dom = op->domain;
>> struct domain *d = rcu_lock_domain_by_id(dom);
>> struct vcpu *v;
>> cpumask_t new_affinity;
>> ......
>> if ( op->cmd == XEN_DOMCTL_setvcpuaffinity )
>> {
>> xenctl_cpumap_to_cpumask( >>>>> the new_affinity is not
>> initialized for if cpumap==NULL
>> &new_affinity, &op->u.vcpuaffinity.cpumap);
>> ret = vcpu_set_affinity(v, &new_affinity);
>> }
>>
>> Thanks
>> --jyh
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Shall we clear the cpumap in XEN_DOMCTL_setvcpuaffinity
2010-05-12 7:57 ` Jiang, Yunhong
@ 2010-05-12 8:11 ` Keir Fraser
0 siblings, 0 replies; 4+ messages in thread
From: Keir Fraser @ 2010-05-12 8:11 UTC (permalink / raw)
To: Jiang, Yunhong; +Cc: xen-devel@lists.xensource.com
It's in the staging tree
http://xenbits.xensource.com/staging/xen-unstable.hg
-- Keir
On 12/05/2010 08:57, "Jiang, Yunhong" <yunhong.jiang@intel.com> wrote:
> Thanks, although "no changes found" after hg pull :-)
>
> --jyh
>
>> -----Original Message-----
>> From: Keir Fraser [mailto:keir.fraser@eu.citrix.com]
>> Sent: Wednesday, May 12, 2010 3:43 PM
>> To: Jiang, Yunhong
>> Cc: xen-devel@lists.xensource.com
>> Subject: Re: Shall we clear the cpumap in XEN_DOMCTL_setvcpuaffinity
>>
>> On 12/05/2010 08:22, "Jiang, Yunhong" <yunhong.jiang@intel.com> wrote:
>>
>>> When browse code, I noticed if the op->u.vcpuaffinity.cpumap is NULL, a
>>> random
>>> value of new_affinity will be passed to vcpu_set_affinity(), as in followed
>>> code.
>>>
>>> I'm not sure if this is expected result. IMO, we should return -EINVAL if no
>>> cpu specified, as the return value at vcpu_set_affinity() for empty cpumap.
>>
>> Xen-unstable:21350.
>>
>> Thanks,
>> Keir
>>
>>> Did I missed anything?
>>>
>>> case XEN_DOMCTL_getvcpuaffinity:
>>> {
>>> domid_t dom = op->domain;
>>> struct domain *d = rcu_lock_domain_by_id(dom);
>>> struct vcpu *v;
>>> cpumask_t new_affinity;
>>> ......
>>> if ( op->cmd == XEN_DOMCTL_setvcpuaffinity )
>>> {
>>> xenctl_cpumap_to_cpumask( >>>>> the new_affinity is not
>>> initialized for if cpumap==NULL
>>> &new_affinity, &op->u.vcpuaffinity.cpumap);
>>> ret = vcpu_set_affinity(v, &new_affinity);
>>> }
>>>
>>> Thanks
>>> --jyh
>>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-05-12 8:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-12 7:22 Shall we clear the cpumap in XEN_DOMCTL_setvcpuaffinity Jiang, Yunhong
2010-05-12 7:43 ` Keir Fraser
2010-05-12 7:57 ` Jiang, Yunhong
2010-05-12 8:11 ` Keir Fraser
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).