[libvirt] [PATCH 05/10] new numa parameters

Daniel P. Berrange berrange at redhat.com
Thu Nov 3 12:15:58 UTC 2011


On Thu, Nov 03, 2011 at 07:55:20PM +0800, Hu Tao wrote:
> This patch adds two parameters: strict and exclusive that we can
> get/set through cpuset.
> ---
>  src/conf/domain_conf.c |   15 +++++++++++++++
>  src/conf/domain_conf.h |    2 ++
>  2 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 0cf3bb7..02a144b 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -6802,6 +6802,10 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
>      VIR_FREE(nodes);
>  
>      /* Extract numatune if exists. */
> +
> +    def->numatune.strict = 0;
> +    def->numatune.exclusive = 0;
> +
>      if ((n = virXPathNodeSet("./numatune", ctxt, NULL)) < 0) {
>          virDomainReportError(VIR_ERR_INTERNAL_ERROR,
>                               "%s", _("cannot extract numatune nodes"));
> @@ -6829,6 +6833,13 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
>                                  "%s", _("nodeset for NUMA memory tuning must be set"));
>              goto error;
>          }
> +
> +        if (virXPathNode("./numatune/strict", ctxt)) {
> +            def->numatune.strict = 1;
> +        }
> +        if (virXPathNode("./numatune/exclusive", ctxt)) {
> +            def->numatune.exclusive = 1;
> +        }
>      }
>  
>      n = virXPathNodeSet("./features/*", ctxt, &nodes);
> @@ -10876,6 +10887,10 @@ virDomainDefFormatInternal(virDomainDefPtr def,
>  
>          virBufferAsprintf(buf, "    <memory nodeset='%s'/>\n", nodemask);
>          VIR_FREE(nodemask);
> +        if (def->numatune.strict)
> +            virBufferAsprintf(buf, "    <strict/>\n");
> +        if (def->numatune.exclusive)
> +            virBufferAsprintf(buf, "    <exclusive/>\n");
>          virBufferAddLit(buf, "  </numatune>\n");
>      }
>  
> diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
> index ca68437..f3dbece 100644
> --- a/src/conf/domain_conf.h
> +++ b/src/conf/domain_conf.h
> @@ -1355,6 +1355,8 @@ struct _virDomainNumatuneDef {
>          char *nodemask;
>      } memory;
>  
> +    int strict;
> +    int exclusive;
>      /* Future NUMA tuning related stuff should go here. */
>  };

NACK to this for the same reason as the previous patch - we can't simply
change the XML format at will to suit a new backend implementation.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list