All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Juergen Gross <jgross@suse.com>, Wei Liu <wei.liu2@citrix.com>,
	Dario Faggioli <dario.faggioli@citrix.com>,
	ian.jackson@eu.citrix.com, xen-devel@lists.xen.org,
	Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: Re: [PATCH v6 02/18] xl / libxl: push parsing of SSID and CPU pool ID down to libxl
Date: Tue, 10 Jun 2014 15:16:11 +0100	[thread overview]
Message-ID: <20140610141611.GN11959@zion.uk.xensource.com> (raw)
In-Reply-To: <1402405075.1250.104.camel@kazak.uk.xensource.com>

On Tue, Jun 10, 2014 at 01:57:55PM +0100, Ian Campbell wrote:
> On Mon, 2014-06-09 at 13:43 +0100, Wei Liu wrote:
> > This patch pushes parsing of "init_seclabel", "seclabel",
> > "device_model_stubdomain_seclabel" and "pool" down to libxl level.
> > 
> > Originally the parsing is done in xl level, which is not ideal because
> > libxl won't have the truely relevant information. With this patch libxl
> > holds important information by itself.
> > 
> > The libxl IDL is extended to hold the string of labels and pool name.
> > And if there those strings are present they take precedence over the
> > numeric representations.
> > 
> > As all relevant structures have a field called X_name / X_label now, a
> > string is also copied there so that we can use it directly.
> 
> I'm not sure what you mean by this. Do you mean that if the caller uses
> the numeric and not the string version we will populate the string side?
> 

I mean I added string field in libxl_dominfo etc, so that caller won't
have to do the translation.

I shall make this clearer in commit message.

> >   In order to
> > be compatible with users of older versions of libxl, this patch also
> > defines LIBXL_HAVE_SSID_LABEL and LIBXL_HAVE_CPUPOOL_NAME. If they are
> > defined, the respective strings are available. And if those strings are
> > not NULL, libxl will do the parsing and ignore the numeric values.
> > 
> > Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> > Cc: Dario Faggioli <dario.faggioli@citrix.com>
> > Cc: Juergen Gross <juergen.gross@ts.fujitsu.com>
> > Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> 
> (I switched to Juergen's new address in the CC)
> 
> > ---
> >  tools/libxl/libxl.c         |   19 ++++++--
> >  tools/libxl/libxl.h         |   20 ++++++++
> >  tools/libxl/libxl_create.c  |   57 +++++++++++++++++++++++
> >  tools/libxl/libxl_dm.c      |    4 ++
> >  tools/libxl/libxl_types.idl |    6 +++
> >  tools/libxl/xl_cmdimpl.c    |  107 ++++++++++++-------------------------------
> >  tools/libxl/xl_sxp.c        |    7 +--
> >  7 files changed, 134 insertions(+), 86 deletions(-)
> > 
> > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> > index 900b8d4..5f320ca 100644
> > --- a/tools/libxl/libxl.c
> > +++ b/tools/libxl/libxl.c
> > @@ -516,12 +516,18 @@ int libxl_domain_preserve(libxl_ctx *ctx, uint32_t domid,
> >      return 0;
> >  }
> >  
> > -static void xcinfo2xlinfo(const xc_domaininfo_t *xcinfo,
> > +static void xcinfo2xlinfo(libxl_ctx *ctx,
> > +                          const xc_domaininfo_t *xcinfo,
> >                            libxl_dominfo *xlinfo)
> >  {
> > +    size_t size;
> > +
> >      memcpy(&(xlinfo->uuid), xcinfo->handle, sizeof(xen_domain_handle_t));
> >      xlinfo->domid = xcinfo->domain;
> >      xlinfo->ssidref = xcinfo->ssidref;
> > +    if (libxl_flask_sid_to_context(ctx, xlinfo->ssidref,
> > +                                   &xlinfo->ssid_label, &size) < 0)
> > +        xlinfo->ssid_label = NULL;
> 
> libxl_set_memory_target uses xcinfo2xlinfo but incorrectly fails to call
> dispose on the result, so it will leak any ssid_label.
> 

I will fix this.

Wei.

> The other callers of this function all seem to return the result to the
> application, which can be expected to be correct here.
> 
> Other than that:
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
> Ian.

  reply	other threads:[~2014-06-10 14:16 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-09 12:43 [PATCH v6 00/18] libxl: JSON infrastructure, fixes and prerequisite patches for new API Wei Liu
2014-06-09 12:43 ` [PATCH v6 01/18] libxl: make cpupool_qualifier_to_cpupoolid a library function Wei Liu
2014-06-09 12:43 ` [PATCH v6 02/18] xl / libxl: push parsing of SSID and CPU pool ID down to libxl Wei Liu
2014-06-10 12:57   ` Ian Campbell
2014-06-10 14:16     ` Wei Liu [this message]
2014-06-09 12:43 ` [PATCH v6 03/18] xl / libxl: push VCPU affinity pinning " Wei Liu
2014-06-09 12:53   ` Wei Liu
2014-06-10  6:59   ` Dario Faggioli
2014-06-10  8:09     ` Wei Liu
2014-06-10 13:01       ` Ian Campbell
2014-06-10 13:09         ` Dario Faggioli
2014-06-10 13:46           ` Wei Liu
2014-06-10 14:01   ` Ian Campbell
2014-06-10 14:06     ` Wei Liu
2014-06-10 15:59       ` Dario Faggioli
2014-06-09 12:43 ` [PATCH v6 04/18] libxl: libxl_uuid_copy now takes a ctx argument Wei Liu
2014-06-10 13:05   ` Ian Campbell
2014-06-10 13:55     ` Wei Liu
2014-06-09 12:43 ` [PATCH v6 05/18] xl: remove parsing of "vncviewer" option in xl domain config file Wei Liu
2014-06-09 12:43 ` [PATCH v6 06/18] libxl: fix JSON generator for uint64_t Wei Liu
2014-06-09 12:43 ` [PATCH v6 07/18] libxl IDL: rename json_fn to json_gen_fn Wei Liu
2014-06-09 12:43 ` [PATCH v6 08/18] libxl_json: introduce libxl__object_from_json Wei Liu
2014-06-09 12:43 ` [PATCH v6 09/18] libxl_json: introduce parser functions for builtin types Wei Liu
2014-06-09 12:43 ` [PATCH v6 10/18] libxl/gentypes.py: special-case KeyedUnion map handle generation Wei Liu
2014-06-09 12:43 ` [PATCH v6 11/18] libxl/gentypes.py: don't generate default values Wei Liu
2014-06-10 13:25   ` Ian Campbell
2014-06-10 13:43     ` Wei Liu
2014-06-10 14:31       ` Wei Liu
2014-06-10 14:56       ` Ian Campbell
2014-06-10 15:49         ` Wei Liu
2014-06-10 15:54           ` Ian Campbell
2014-06-10 15:59             ` Wei Liu
2014-06-09 12:43 ` [PATCH v6 12/18] libxl IDL: generate code to parse libxl__json_object to libxl_FOO struct Wei Liu
2014-06-10 13:32   ` Ian Campbell
2014-06-09 12:43 ` [PATCH v6 13/18] libxl/gentest.py: test JSON parser Wei Liu
2014-06-09 12:43 ` [PATCH v6 14/18] libxl: introduce libxl_key_value_list_length Wei Liu
2014-06-09 12:43 ` [PATCH v6 15/18] libxl: introduce libxl_cpuid_policy_list_length Wei Liu
2014-06-09 12:43 ` [PATCH v6 16/18] libxl: copy function for builtin types Wei Liu
2014-06-09 12:43 ` [PATCH v6 17/18] libxl IDL: generate deep copy functions Wei Liu
2014-06-09 12:43 ` [PATCH v6 18/18] libxl/gentest.py: test " Wei Liu
2014-06-10 14:14 ` [PATCH v6 00/18] libxl: JSON infrastructure, fixes and prerequisite patches for new API Ian Campbell
2014-06-10 20:10   ` Boris Ostrovsky
2014-06-10 20:51     ` Boris Ostrovsky
2014-06-10 21:21       ` Wei Liu
2014-06-10 21:38         ` Boris Ostrovsky
2014-06-10 21:42           ` Wei Liu
2014-06-11  8:47         ` Ian Campbell
2014-06-11  8:53           ` Wei Liu

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=20140610141611.GN11959@zion.uk.xensource.com \
    --to=wei.liu2@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jgross@suse.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.