From: Dario Faggioli <raistlin@linux.it>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [PATCH 2 of 3] libxl: allow for specifying the CPU affinity in the config file.
Date: Thu, 12 Jan 2012 22:56:37 +0000 [thread overview]
Message-ID: <1326408997.4494.11.camel@Abyss> (raw)
In-Reply-To: <1326357782.17210.213.camel@zakaz.uk.xensource.com>
[-- Attachment #1.1: Type: text/plain, Size: 2729 bytes --]
On Thu, 2012-01-12 at 08:43 +0000, Ian Campbell wrote:
> > diff -r 9ce68a4036b1 tools/libxl/libxl_create.c
> > --- a/tools/libxl/libxl_create.c Wed Jan 11 17:38:04 2012 +0000
> > +++ b/tools/libxl/libxl_create.c Wed Jan 11 17:40:45 2012 +0000
> > @@ -78,6 +78,8 @@ int libxl_init_build_info(libxl_ctx *ctx
> > memset(b_info, '\0', sizeof(*b_info));
> > b_info->max_vcpus = 1;
> > b_info->cur_vcpus = 1;
> > + if (libxl_cpumap_alloc(ctx, &b_info->cpumap))
> > + return ERROR_NOMEM;
>
> Should probably set all here since that is the best default?
>
Having this set to "none" here simplifies a bit the code when we came to
config file parsing (if I set it to "any CPU" here, I'll have to reset
to "none" before parsing). Also, default is exactly what you're
suggesting already, as I set the map to "any CPU" if no "cpus" config
option is found.
Anyway, I guess I can do as you suggest if you really think it's
better. :-)
> > +static void print_bitmap(uint8_t *map, int maplen, FILE *stream);
>
> [..]
>
> > +static int vcpupin_parse(char *cpu, libxl_cpumap *cpumap);
>
> Again, maybe just reorder the functions?
>
Ok, fine, will do that.
> > static void parse_config_data(const char *configfile_filename_report,
> > const char *configfile_data,
> > int configfile_len,
> > @@ -661,6 +674,13 @@ static void parse_config_data(const char
> > if (!xlu_cfg_get_long (config, "maxvcpus", &l, 0))
> > b_info->max_vcpus = l;
> >
> > + if (!xlu_cfg_get_string (config, "cpus", &buf, 0)) {
>
> The syntax supported here is different to that in a cpupool cfg? (see
> main_cpupoolcreate) Perhaps they should be similar?
>
It is different, and that was intentional. What I wanted, was the syntax
to be exactly the same of `xl vcpu-pin', which is the command line
equivalent of this option, much more than cpupool-*. If you want, I
think I can easily enable list-like CPU specification as in cpupool
config file so that _both_ syntax are allowed. What do you think?
> > + char *buf2 = strdup(buf);
> > + vcpupin_parse(buf2, &b_info->cpumap);
> > + } else {
> > + memset(b_info->cpumap.map, -1, b_info->cpumap.size);
>
> This could do with a helper function in libxl_utils.h.
>
Ok.
Thanks,
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-------------------------------------------------------------------
Dario Faggioli, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
PhD Candidate, ReTiS Lab, Scuola Superiore Sant'Anna, Pisa (Italy)
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2012-01-12 22:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-11 17:49 [PATCH 0 of 3] libxl: Extend CPU affinity specification and enable it in config file Dario Faggioli
2012-01-11 17:58 ` [PATCH 1 of 3] libxl: extend pCPUs specification for vcpu-pin Dario Faggioli
2012-01-12 8:38 ` Ian Campbell
2012-01-12 17:34 ` Ian Jackson
2012-01-12 23:12 ` Dario Faggioli
2012-01-13 13:34 ` Ian Jackson
2012-01-13 16:45 ` Dario Faggioli
2012-01-13 16:48 ` Ian Jackson
2012-01-23 10:21 ` Ian Campbell
2012-01-23 10:27 ` Dario Faggioli
2012-01-23 10:50 ` Ian Campbell
2012-01-11 18:00 ` [PATCH 2 of 3] libxl: allow for specifying the CPU affinity in the config file Dario Faggioli
2012-01-12 8:43 ` Ian Campbell
2012-01-12 22:56 ` Dario Faggioli [this message]
2012-01-13 8:09 ` Ian Campbell
2012-01-13 9:13 ` Dario Faggioli
2012-01-11 18:01 ` [PATCH 3 of 3] libxl: Align examples with current code Dario Faggioli
2012-01-12 8:37 ` Ian Campbell
2012-01-12 22:45 ` Dario Faggioli
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=1326408997.4494.11.camel@Abyss \
--to=raistlin@linux.it \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.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.