From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
Dan Magenheimer <dan.magenheimer@oracle.com>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [PATCH 2/6] xl: Implement XENMEM_claim_pages support via 'claim_mode' global config
Date: Fri, 12 Apr 2013 16:07:59 -0400 [thread overview]
Message-ID: <20130412200759.GB20464@phenom.dumpdata.com> (raw)
In-Reply-To: <20130412195104.GD19721@phenom.dumpdata.com>
On Fri, Apr 12, 2013 at 03:51:04PM -0400, Konrad Rzeszutek Wilk wrote:
> > Of these I prefer 1. Opinions ? Whatever we do needs to be in 4.3.
>
> There is also option 5. Define a new macro:
>
> diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> index 4922313..4a6ee76 100644
> --- a/tools/libxl/libxl.h
> +++ b/tools/libxl/libxl.h
> @@ -359,6 +359,11 @@ typedef struct {
> int val;
> } libxl_defbool;
>
> +#define DEFINE_BOOL(name, _val) \
> + libxl_defbool name = { .val = _val }
> +#define DEFINE_FALSE_BOOL(name) DEFINE_BOOL(name, LIBXL__DEFBOOL_FALSE)
> +#define DEFINE_TRUE_BOOL(name) DEFINE_BOOL(name, LIBXL__DEFBOOL_TRUE)
> +
> void libxl_defbool_set(libxl_defbool *db, bool b);
> /* Resets to default */
> void libxl_defbool_unset(libxl_defbool *db);
>
>
> And use DEFINE_FALSE_BOOL(claim_mode) in the xl.h file.
>
Correction (But now that I look at it, it is not that much nicer as you
end up with LIBXL__DEFBOOL in the header file. <sigh>
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 03a9782..436b60c 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -222,10 +222,6 @@ void libxl_key_value_list_dispose(libxl_key_value_list *pkvl)
free(kvl);
}
-#define LIBXL__DEFBOOL_DEFAULT (0)
-#define LIBXL__DEFBOOL_FALSE (-1)
-#define LIBXL__DEFBOOL_TRUE (1)
-
void libxl_defbool_set(libxl_defbool *db, bool b)
{
db->val = b ? LIBXL__DEFBOOL_TRUE : LIBXL__DEFBOOL_FALSE;
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 4922313..308a315 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -359,6 +359,15 @@ typedef struct {
int val;
} libxl_defbool;
+#define LIBXL__DEFBOOL_DEFAULT (0)
+#define LIBXL__DEFBOOL_FALSE (-1)
+#define LIBXL__DEFBOOL_TRUE (1)
+
+#define DEFINE_BOOL(name, _val) \
+ libxl_defbool name = { .val = _val }
+#define DEFINE_FALSE_BOOL(name) DEFINE_BOOL(name, LIBXL__DEFBOOL_FALSE)
+#define DEFINE_TRUE_BOOL(name) DEFINE_BOOL(name, LIBXL__DEFBOOL_TRUE)
+
void libxl_defbool_set(libxl_defbool *db, bool b);
/* Resets to default */
void libxl_defbool_unset(libxl_defbool *db);
diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index 3c141bf..4b42b87 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -46,7 +46,7 @@ char *default_vifscript = NULL;
char *default_bridge = NULL;
char *default_gatewaydev = NULL;
enum output_format default_output_format = OUTPUT_FORMAT_JSON;
-libxl_defbool claim_mode;
+DEFINE_FALSE_BOOL(claim_mode);
static xentoollog_level minmsglevel = XTL_PROGRESS;
@@ -170,7 +170,6 @@ static void parse_global_config(const char *configfile,
if (!xlu_cfg_get_string (config, "blkdev_start", &buf, 0))
blkdev_start = strdup(buf);
- libxl_defbool_setdefault(&claim_mode, false);
(void)xlu_cfg_get_defbool (config, "claim_mode", &claim_mode, 0);
xlu_cfg_destroy(config);
next prev parent reply other threads:[~2013-04-12 20:07 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-10 19:59 [PATCH v15] claim and its friends for allocating multiple self-ballooning guests Konrad Rzeszutek Wilk
2013-04-10 19:59 ` [PATCH 1/6] xc: use XENMEM_claim_pages hypercall during guest creation Konrad Rzeszutek Wilk
2013-04-12 15:16 ` Ian Jackson
2013-04-10 19:59 ` [PATCH 2/6] xl: Implement XENMEM_claim_pages support via 'claim_mode' global config Konrad Rzeszutek Wilk
2013-04-12 15:17 ` Ian Jackson
2013-04-12 17:18 ` Ian Jackson
2013-04-12 18:03 ` Ian Jackson
2013-04-12 18:04 ` Ian Jackson
2013-04-12 19:51 ` Konrad Rzeszutek Wilk
2013-04-12 20:07 ` Konrad Rzeszutek Wilk [this message]
2013-04-15 9:26 ` Ian Campbell
2013-04-15 9:34 ` Ian Campbell
2013-04-15 23:20 ` konrad wilk
2013-04-16 8:50 ` Ian Campbell
2013-04-10 19:59 ` [PATCH 3/6] xl: 'xl info' print outstanding claims if enabled (claim_mode=1 in xl.conf) Konrad Rzeszutek Wilk
2013-04-12 15:18 ` Ian Jackson
2013-04-10 19:59 ` [PATCH 4/6] xc: export outstanding_pages value in xc_dominfo structure Konrad Rzeszutek Wilk
2013-04-12 15:18 ` Ian Jackson
2013-04-10 19:59 ` [PATCH 5/6] xl: export 'outstanding_pages' value from xcinfo Konrad Rzeszutek Wilk
2013-04-12 15:19 ` Ian Jackson
2013-04-10 19:59 ` [PATCH 6/6] xl: 'xl claims' print outstanding per domain claims if enabled (claim_mode=1 in xl.conf) Konrad Rzeszutek Wilk
2013-04-10 20:08 ` Konrad Rzeszutek Wilk
2013-04-12 15:24 ` Ian Jackson
2013-04-12 16:49 ` Konrad Rzeszutek Wilk
2013-04-12 17:10 ` Ian Jackson
2013-04-12 10:55 ` [PATCH v15] claim and its friends for allocating multiple self-ballooning guests George Dunlap
2013-04-12 13:44 ` Konrad Rzeszutek Wilk
2013-04-12 17:20 ` Ian Jackson
2013-04-16 10:19 ` George Dunlap
2013-04-16 10:57 ` Ian Jackson
2013-04-16 10:58 ` George Dunlap
-- strict thread matches above, loose matches on Subject: below --
2013-03-27 20:55 [PATCH v13] " Konrad Rzeszutek Wilk
2013-03-27 20:55 ` [PATCH 2/6] xl: Implement XENMEM_claim_pages support via 'claim_mode' global config Konrad Rzeszutek Wilk
2013-03-28 16:39 ` Ian Jackson
2013-03-29 19:30 ` Konrad Rzeszutek Wilk
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=20130412200759.GB20464@phenom.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=dan.magenheimer@oracle.com \
--cc=xen-devel@lists.xensource.com \
/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.