[libvirt] [PATCH 3/3] conf: numa: Check ABI stability of NUMA configuration

Peter Krempa pkrempa at redhat.com
Fri Feb 20 18:36:08 UTC 2015


On Thu, Feb 19, 2015 at 19:37:33 -0500, John Ferlan wrote:
> 
> OK - I peeked after looking at 24/24 to see how difficult this series
> would be (and before soaking my brain cells in liquid refreshment)...
> 
> The first two seemed OK and it doesn't appear there's anyone else
> disagreeing...
> 
> For this one though...
> 
> On 02/16/2015 02:50 PM, Peter Krempa wrote:
> > Add helper to compare initial sizes of indivitual NUMA nodes and the map
> > of belonging vCPUs. Other configuration is not ABI.
> > ---
> >  src/conf/domain_conf.c   |  3 +++
> >  src/conf/numa_conf.c     | 37 +++++++++++++++++++++++++++++++++++++
> >  src/conf/numa_conf.h     |  3 +++
> >  src/libvirt_private.syms |  1 +
> >  4 files changed, 44 insertions(+)
> > 
> > diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> > index eee01b6..15d4fe0 100644
> > --- a/src/conf/domain_conf.c
> > +++ b/src/conf/domain_conf.c
> > @@ -15964,6 +15964,9 @@ virDomainDefCheckABIStability(virDomainDefPtr src,
> >          goto error;
> >      }
> > 
> > +    if (!virDomainNumaCheckABIStability(src->numa, dst->numa))
> > +        goto error;
> > +
> >      if (src->vcpus != dst->vcpus) {
> >          virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> >                         _("Target domain vCPU count %d does not match source %d"),
> > diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c
> > index 0a6f902..70044d5 100644
> > --- a/src/conf/numa_conf.c
> > +++ b/src/conf/numa_conf.c
> > @@ -814,6 +814,43 @@ virDomainNumaNew(void)
> >  }
> > 
> > 
> > +bool
> > +virDomainNumaCheckABIStability(virDomainNumaPtr src,
> > +                               virDomainNumaPtr tgt)
> > +{
> > +    size_t i;
> > +
> > +    if (virDomainNumaGetNodeCount(src) != virDomainNumaGetNodeCount(tgt)) {
> > +        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> > +                       _("Target NUMA node count '%zu' doesn't match "
> > +                         "source '%zu'"),
> > +                       virDomainNumaGetNodeCount(tgt),
> > +                       virDomainNumaGetNodeCount(src));
> > +        return false;
> > +    }
> > +
> > +    for (i = 0; i < virDomainNumaGetNodeCount(src); i++) {
> > +        if (src->mem_nodes[i].mem != tgt->mem_nodes[i].mem) {
> 
> Use virDomainNumaGetNodeMemorySize() ?
> 
> > +            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> > +                           _("Size of target NUMA node %zu (%llu) doesn't "
> > +                             "match source (%llu)"), i,
> > +                           tgt->mem_nodes[i].mem, src->mem_nodes[i].mem);
> > +            return false;
> > +        }
> > +
> > +        if (!virBitmapEqual(src->mem_nodes[i].cpumask,
> > +                            tgt->mem_nodes[i].cpumask)) {
> 
> Use virDomainNumaGetNodeCpumask to access each cpumask bitmap ?
> 
> 
> This seems reasonable to me...
> 
> ACK with the accessor changes...

I've changed to the accessor-based approach and pushed this one along
with patch 1.

Thanks.

Peter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150220/5bc0f9d2/attachment-0001.sig>


More information about the libvir-list mailing list