All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: xen-devel@lists.xen.org
Cc: Andrew.Cooper3@citrix.com, Wei Liu <wei.liu2@citrix.com>,
	Ian.Campbell@citrix.com, Ian.Jackson@citrix.com
Subject: [PATCH v10 07/11] libxl/xl: deprecate the build_info->cpumap field
Date: Fri, 20 Jun 2014 18:19:48 +0200	[thread overview]
Message-ID: <20140620161947.450.64066.stgit@Solace> (raw)
In-Reply-To: <20140620161751.450.15846.stgit@Solace>

as, thanks to previous change ("libxl/xl: push VCPU affinity
pinning down to libxl"), we now have an array of libxl_bitmap-s
that can be used to transfer to libxl the vcpu (hard) affinity
of each vcpu of the domain.

The cpumap field, used to provide libxl with just one cpumap
that should be applied to all vcpus, is therefore of no more
use. Actually, it is duplicated information and can lead to
confusion.

With this change, we make it even more clear that the preferred
way of specifying VCPU affinity is from now on, the vcpu_hard_affinity
array. To do so, mark the cpumap field as DEPRECATED. It still is
there, and it is still honoured, for backward compatibility reasons,
but it should no longer be used.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
---
Changes from v9:
 * get rid of the xl part, which now lives in its separate
   patch, as requested during review;
 * updated the comment in libxl_types.idl, mentioning what
   happens if both cpumap and vcpu_hard_affinity are used,
   as requested during review.

Changes from v8:
 * don't get rid of b_info->cpumap handling, so old apps
   continue to work, as requested during review;
 * changelog and code comments updated accordingly.
---
 tools/libxl/libxl_dom.c     |    9 ++++++++-
 tools/libxl/libxl_types.idl |    8 +++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 7a60ee2..81e77c0 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -283,9 +283,16 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid,
                 return ERROR_FAIL;
             }
         }
-    } else if (info->cpumap.size)
+    } else if (info->cpumap.size) {
+        /*
+         * Although info->cpumap is DEPRECATED, we still want old
+         * applications that may be using it to continue working.
+         */
+        LOG(WARN, "cpumap field of libxl_domain_build_info is DEPRECATED. "
+                  "Please, use the vcpu_hard_affinity array instead");
         libxl_set_vcpuaffinity_all(ctx, domid, info->max_vcpus,
                                    &info->cpumap, NULL);
+    }
 
 
     if (xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb +
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 5607ea7..477b2a6 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -301,7 +301,13 @@ libxl_domain_sched_params = Struct("domain_sched_params",[
 libxl_domain_build_info = Struct("domain_build_info",[
     ("max_vcpus",       integer),
     ("avail_vcpus",     libxl_bitmap),
-    ("cpumap",          libxl_bitmap),
+    ("cpumap",          libxl_bitmap), # DEPRECATED!
+    # The cpumap field above has been deprecated by the introduction of the
+    # vcpu_hard_affinity array. It is not removed and it is still honoured, for
+    # API stability and backward compatibility reasons, but should not be used
+    # any longer. The vcpu_hard_affinity array is what should be used instead.
+    # As per libxl.h, if both cpumap and vcpu_hard_affinity are used, the latter
+    # will prevail.
     ("nodemap",         libxl_bitmap),
     ("vcpu_hard_affinity", Array(libxl_bitmap, "num_vcpu_hard_affinity")),
     ("numa_placement",  libxl_defbool),

  parent reply	other threads:[~2014-06-20 16:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20 16:18 [PATCH v10 00/11] Series short description Dario Faggioli
2014-06-20 16:18 ` [PATCH v10 01/11] libxc/libxl: bump library SONAMEs Dario Faggioli
2014-06-20 16:19 ` [PATCH v10 02/11] libxc: get and set soft and hard affinity Dario Faggioli
2014-06-20 16:19 ` [PATCH v10 03/11] libxl: get and set soft affinity Dario Faggioli
2014-06-20 16:19 ` [PATCH v10 04/11] xl: enable getting and setting " Dario Faggioli
2014-06-27 12:33   ` Ian Campbell
2014-06-27 13:18     ` Dario Faggioli
2014-06-27 13:22       ` Ian Campbell
2014-06-27 13:45         ` Dario Faggioli
2014-06-20 16:19 ` [PATCH v10 05/11] libxl: Change default for b_info->{cpu, node}map to "not allocated" Dario Faggioli
2014-06-27 10:44   ` Ian Campbell
2014-06-27 12:07     ` Dario Faggioli
2014-06-27 12:44       ` Ian Campbell
2014-06-20 16:19 ` [PATCH v10 06/11] libxl/xl: push VCPU affinity pinning down to libxl Dario Faggioli
2014-06-27 10:55   ` Ian Campbell
2014-06-20 16:19 ` Dario Faggioli [this message]
2014-06-27 10:57   ` [PATCH v10 07/11] libxl/xl: deprecate the build_info->cpumap field Ian Campbell
2014-06-27 12:08     ` Dario Faggioli
2014-06-20 16:19 ` [PATCH v10 08/11] xl: move away from the (deprecated) use of cpumap for hard affinity Dario Faggioli
2014-06-27 11:00   ` Ian Campbell
2014-06-27 12:24     ` Dario Faggioli
2014-06-20 16:20 ` [PATCH v10 09/11] xl: move the vcpu affinity parsing in a function Dario Faggioli
2014-06-20 16:20 ` [PATCH v10 10/11] libxl/xl: make it possible to specify soft-affinity in domain config file Dario Faggioli
2014-06-27 12:47   ` Ian Campbell
2014-06-27 13:07     ` Dario Faggioli
2014-06-27 16:41     ` Dario Faggioli
2014-06-20 16:20 ` [PATCH v10 11/11] libxl: automatic NUMA placement affects soft affinity Dario Faggioli
2014-06-27 13:32 ` [PATCH v10 00/11] Series short description Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140620161947.450.64066.stgit@Solace \
    --to=dario.faggioli@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.