From: Dario Faggioli <dario.faggioli@citrix.com>
To: xen-devel@lists.xen.org
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Ian Campbell <Ian.Campbell@citrix.com>
Subject: [RESEND PATCH v5 4/9] libxl: move libxl_{cpu, node}_bitmap_alloc()
Date: Sat, 07 Dec 2013 01:04:55 +0100 [thread overview]
Message-ID: <20131207000455.22982.76873.stgit@Solace> (raw)
In-Reply-To: <20131206233642.22982.76947.stgit@Solace>
in libxl_utils.c (from .h), as they will be reworked in
the next commit ("libxc/libxl: sanitize error handling in
*_get_max_{cpus,nodes}") and we want to keep code motion
separate from functional changes.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
---
Changes from v5:
* new patch, as requested during review.
---
tools/libxl/libxl_utils.c | 25 +++++++++++++++++++++++++
tools/libxl/libxl_utils.h | 29 +++--------------------------
2 files changed, 28 insertions(+), 26 deletions(-)
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 9f5f589..93f7a87 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -651,6 +651,31 @@ char *libxl_bitmap_to_hex_string(libxl_ctx *ctx, const libxl_bitmap *bitmap)
return q;
}
+int libxl_cpu_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *cpumap, int max_cpus)
+{
+ if (max_cpus < 0)
+ return ERROR_INVAL;
+ if (max_cpus == 0)
+ max_cpus = libxl_get_max_cpus(ctx);
+ if (max_cpus == 0)
+ return ERROR_FAIL;
+
+ return libxl_bitmap_alloc(ctx, cpumap, max_cpus);
+}
+
+int libxl_node_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *nodemap,
+ int max_nodes)
+{
+ if (max_nodes < 0)
+ return ERROR_INVAL;
+ if (max_nodes == 0)
+ max_nodes = libxl_get_max_nodes(ctx);
+ if (max_nodes == 0)
+ return ERROR_FAIL;
+
+ return libxl_bitmap_alloc(ctx, nodemap, max_nodes);
+}
+
int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
const libxl_bitmap *nodemap,
libxl_bitmap *cpumap)
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
index 7b84e6a..e37fb89 100644
--- a/tools/libxl/libxl_utils.h
+++ b/tools/libxl/libxl_utils.h
@@ -98,32 +98,9 @@ static inline int libxl_bitmap_cpu_valid(libxl_bitmap *bitmap, int bit)
#define libxl_for_each_set_bit(v, m) for (v = 0; v < (m).size * 8; v++) \
if (libxl_bitmap_test(&(m), v))
-static inline int libxl_cpu_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *cpumap,
- int max_cpus)
-{
- if (max_cpus < 0)
- return ERROR_INVAL;
- if (max_cpus == 0)
- max_cpus = libxl_get_max_cpus(ctx);
- if (max_cpus == 0)
- return ERROR_FAIL;
-
- return libxl_bitmap_alloc(ctx, cpumap, max_cpus);
-}
-
-static inline int libxl_node_bitmap_alloc(libxl_ctx *ctx,
- libxl_bitmap *nodemap,
- int max_nodes)
-{
- if (max_nodes < 0)
- return ERROR_INVAL;
- if (max_nodes == 0)
- max_nodes = libxl_get_max_nodes(ctx);
- if (max_nodes == 0)
- return ERROR_FAIL;
-
- return libxl_bitmap_alloc(ctx, nodemap, max_nodes);
-}
+int libxl_cpu_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *cpumap, int max_cpus);
+int libxl_node_bitmap_alloc(libxl_ctx *ctx, libxl_bitmap *nodemap,
+ int max_nodes);
/* Populate cpumap with the cpus spanned by the nodes in nodemap */
int libxl_nodemap_to_cpumap(libxl_ctx *ctx,
next prev parent reply other threads:[~2013-12-07 0:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-07 0:04 [RESEND PATCH v5 0/9] vcpu soft affinity for credit1 (first half only) Dario Faggioli
2013-12-07 0:04 ` [RESEND PATCH v5 1/9] xl: match output of vcpu-list with pinning syntax Dario Faggioli
2013-12-07 0:04 ` [RESEND PATCH v5 2/9] libxl: better name for parameters in libxl_list_vcpu Dario Faggioli
2013-12-07 0:04 ` [RESEND PATCH v5 3/9] libxl: fix memory leak " Dario Faggioli
2013-12-07 0:04 ` Dario Faggioli [this message]
2013-12-09 15:16 ` [RESEND PATCH v5 4/9] libxl: move libxl_{cpu, node}_bitmap_alloc() Ian Campbell
2013-12-07 0:05 ` [RESEND PATCH v5 5/9] libxc/libxl: sanitize error handling in *_get_max_{cpus, nodes} Dario Faggioli
2013-12-07 0:05 ` [RESEND PATCH v5 6/9] libxc/libxl: allow to retrieve the number of online pCPUs Dario Faggioli
2013-12-07 0:05 ` [RESEND PATCH v5 7/9] xl: allow for node-wise specification of vcpu pinning Dario Faggioli
2013-12-07 0:05 ` [RESEND PATCH v5 8/9] xl: implement and enable dryrun mode for `xl vcpu-pin' Dario Faggioli
2013-12-07 0:05 ` [RESEND PATCH v5 9/9] xl: test script for the cpumap parser (for vCPU pinning) Dario Faggioli
2013-12-09 15:45 ` [RESEND PATCH v5 0/9] vcpu soft affinity for credit1 (first half only) 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=20131207000455.22982.76873.stgit@Solace \
--to=dario.faggioli@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=george.dunlap@eu.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.