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

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

 



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

John
> +            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
> +                           _("Processor mask of target NUMA node %zu doesn't "
> +                             "match source"), i);
> +            return false;
> +        }
> +    }
> +
> +    return true;
> +}
> +
> +
>  size_t
>  virDomainNumaGetNodeCount(virDomainNumaPtr numa)
>  {
> diff --git a/src/conf/numa_conf.h b/src/conf/numa_conf.h
> index 8b3c437..23265af 100644
> --- a/src/conf/numa_conf.h
> +++ b/src/conf/numa_conf.h
> @@ -125,6 +125,9 @@ void virDomainNumaSetNodeMemorySize(virDomainNumaPtr numa,
>  bool virDomainNumaEquals(virDomainNumaPtr n1,
>                           virDomainNumaPtr n2);
> 
> +bool virDomainNumaCheckABIStability(virDomainNumaPtr src,
> +                                    virDomainNumaPtr tgt);
> +
>  bool virDomainNumatuneHasPlacementAuto(virDomainNumaPtr numatune);
> 
>  bool virDomainNumatuneHasPerNodeBinding(virDomainNumaPtr numatune);
> diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
> index 8988b61..c02e089 100644
> --- a/src/libvirt_private.syms
> +++ b/src/libvirt_private.syms
> @@ -627,6 +627,7 @@ virNodeDeviceObjUnlock;
> 
> 
>  # conf/numa_conf.h
> +virDomainNumaCheckABIStability;
>  virDomainNumaEquals;
>  virDomainNumaFree;
>  virDomainNumaGetNodeCount;
> 

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]