Re: [PATCH 3/5] numad: Always output 'placement' of <vcpu>

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

 



On 05/08/2012 10:04 AM, Osier Yang wrote:
> <vcpu> is not an optional node. The value for its 'placement'
> actually always defaults to 'static' in the underlying codes.
> (Even no 'cpuset' and 'placement' is specified, the domain
> process will be pinned to all the available pCPUs).
> ---
>  353 files changed, 359 insertions(+), 367 deletions(-)

I hope you did the bulk of this patch by script.

> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 14b94d3..e0736b0 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -632,7 +632,6 @@ VIR_ENUM_IMPL(virDomainStartupPolicy, VIR_DOMAIN_STARTUP_POLICY_LAST,
>                "optional");
>  
>  VIR_ENUM_IMPL(virDomainCpuPlacementMode, VIR_DOMAIN_CPU_PLACEMENT_MODE_LAST,
> -              "default",
>                "static",
>                "auto");
>  
> @@ -7944,7 +7943,7 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
>          }
>          VIR_FREE(tmp);
>      } else {
> -        def->placement_mode = VIR_DOMAIN_CPU_PLACEMENT_MODE_DEFAULT;
> +        def->placement_mode = VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC;
>      }
>  
>      if (def->placement_mode != VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) {
> @@ -7958,8 +7957,6 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
>              if (virDomainCpuSetParse(set, 0, def->cpumask,
>                                       def->cpumasklen) < 0)
>                  goto error;
> -            if (def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_DEFAULT)
> -                def->placement_mode = VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC;
>              VIR_FREE(tmp);
>          }
>      }
> @@ -8110,13 +8107,10 @@ static virDomainDefPtr virDomainDefParseXML(virCapsPtr caps,
>                      /* Copy 'placement' of <numatune> to <vcpu> if its 'placement'
>                       * is not specified and 'placement' of <numatune> is specified.
>                       */
> -                    if (def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_DEFAULT &&
> -                        placement_mode != VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_DEFAULT) {
> -                        if (placement_mode == VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_STATIC)
> -                            def->placement_mode = VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC;
> -                        else
> +                     if (placement_mode == VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_AUTO &&
> +                         !def->cpumask)
>                              def->placement_mode = VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO;

Indentation looks off here.

> -                    }
> +
>                      def->numatune.memory.placement_mode = placement_mode;
>                  } else {
>                      virDomainReportError(VIR_ERR_XML_ERROR,
> @@ -12503,9 +12497,8 @@ virDomainDefFormatInternal(virDomainDefPtr def,
>              allones = 0;
>  
>      virBufferAddLit(buf, "  <vcpu");
> -    if (def->placement_mode)
> -        virBufferAsprintf(buf, " placement='%s'",
> -                          virDomainCpuPlacementModeTypeToString(def->placement_mode));
> +    virBufferAsprintf(buf, " placement='%s'",
> +                      virDomainCpuPlacementModeTypeToString(def->placement_mode));
>      if (!allones) {
>          char *cpumask = NULL;
>          if ((cpumask =
> diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
> index 92f3f48..52fd572 100644
> --- a/src/conf/domain_conf.h
> +++ b/src/conf/domain_conf.h
> @@ -1409,8 +1409,7 @@ enum virDomainTimerModeType {
>  };
>  
>  enum virDomainCpuPlacementMode {
> -    VIR_DOMAIN_CPU_PLACEMENT_MODE_DEFAULT = 0,
> -    VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC,
> +    VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC = 0,
>      VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO,
>  
>      VIR_DOMAIN_CPU_PLACEMENT_MODE_LAST,

Looks okay; everything else is mostly mechanical or fallout to keep the
testsuite passing with the new xml.

ACK.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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