[libvirt] [PATCH v3 1/2] conf: List only online cpus for virsh vcpupin

Peter Krempa pkrempa at redhat.com
Fri Nov 11 13:55:33 UTC 2016


On Fri, Nov 11, 2016 at 14:51:31 +0100, Viktor Mihajlovski wrote:
> On 11.11.2016 12:26, Nitesh Konkar wrote:
> > Currently when the vcpu placement is static
> > and cpuset is not specified, CPU Affinity
> > under virsh vcpupin shows 0..CPUMAX. This
> > patchset will result in display of only
> > online CPU's under CPU Affinity on linux.
> > 
> > Signed-off-by: Nitesh Konkar <nitkon12 at linux.vnet.ibm.com>
> > ---
> >  src/conf/domain_conf.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> > index 74efe8c..6f81903 100644
> > --- a/src/conf/domain_conf.c
> > +++ b/src/conf/domain_conf.c

[...]

> > @@ -1562,6 +1568,9 @@ virDomainDefGetVcpuPinInfoHelper(virDomainDefPtr def,
> >          else if (def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO &&
> >                   autoCpuset)
> >              bitmap = autoCpuset;
> > +        else if (def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC &&
> > +                 staticCpuset)
> > +            bitmap = staticCpuset;
> I wonder whether you suggest this to reconcile the results of virsh
> vcpupin and virsh vcpuinfo for a running domain? If so, this will not
> work because then you would rather have to query the process' cpu
> affinity, but this can obviously not be done here.

Indeed. This should be used instead of allcpumap in case we are going to
report all ones. Putting it here will report incorrect data in cases
when e.g the correct pinning is set in def->cpumask.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20161111/4fe99ba0/attachment-0001.sig>


More information about the libvir-list mailing list