All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <juergen.gross@ts.fujitsu.com>
To: Ian Campbell <ian.campbell@citrix.com>
Cc: ian.jackson@citrix.com, xen-devel@lists.xensource.com
Subject: Re: [PATCH 1 of 3] libxl: remove	libxl_domain_create_info.poolname
Date: Tue, 24 Jan 2012 08:21:08 +0100	[thread overview]
Message-ID: <4F1E5BE4.3010406@ts.fujitsu.com> (raw)
In-Reply-To: <c91bee33280debdfe602.1327329789@cosworth.uk.xensource.com>

On 01/23/2012 03:43 PM, Ian Campbell wrote:
> # HG changeset patch
> # User Ian Campbell<ian.campbell@citrix.com>
> # Date 1327329346 0
> # Node ID c91bee33280debdfe602d28e48318c03ddf0f4c9
> # Parent  4bb2b6a04ec02c3502c1825e2736df54870229e5
> libxl: remove libxl_domain_create_info.poolname
>
> It is redundant with poolid and allowing the user to specify both
> opens up the possibility of a disconnect.
>
> Also default c_info->poolid to -1 (no pool) instead of defaulting to 0 in the
> library and overriding in the toolstack.
>
> Signed-off-by: Ian Campbell<ian.campbell@citrix.com>
Acked-by: juergen.gross@ts.fujitsu.com
> diff -r 4bb2b6a04ec0 -r c91bee33280d tools/libxl/libxl_create.c
> --- a/tools/libxl/libxl_create.c	Fri Jan 20 17:12:17 2012 +0000
> +++ b/tools/libxl/libxl_create.c	Mon Jan 23 14:35:46 2012 +0000
> @@ -60,7 +60,7 @@ int libxl_init_create_info(libxl_ctx *ct
>       c_info->type = LIBXL_DOMAIN_TYPE_HVM;
>       c_info->oos = 1;
>       c_info->ssidref = 0;
> -    c_info->poolid = 0;
> +    c_info->poolid = -1;
>       return 0;
>   }
>
> @@ -438,8 +438,9 @@ retry_transaction:
>
>       xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/uuid", vm_path), uuid_string, strlen(uuid_string));
>       xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/name", vm_path), info->name, strlen(info->name));
> -    if (info->poolname)
> -        xs_write(ctx->xsh, t, libxl__sprintf(gc, "%s/pool_name", vm_path), info->poolname, strlen(info->poolname));
> +    if (info->poolid != -1)
> +        libxl__xs_write(gc, t, libxl__sprintf(gc, "%s/pool_name", vm_path),
> +                        "%s", libxl__cpupoolid_to_name(gc, info->poolid));
>
>       libxl__xs_writev(gc, t, dom_path, info->xsdata);
>       libxl__xs_writev(gc, t, libxl__sprintf(gc, "%s/platform", dom_path), info->platformdata);
> diff -r 4bb2b6a04ec0 -r c91bee33280d tools/libxl/libxl_types.idl
> --- a/tools/libxl/libxl_types.idl	Fri Jan 20 17:12:17 2012 +0000
> +++ b/tools/libxl/libxl_types.idl	Mon Jan 23 14:35:46 2012 +0000
> @@ -156,7 +156,6 @@ libxl_domain_create_info = Struct("domai
>       ("xsdata",       libxl_key_value_list),
>       ("platformdata", libxl_key_value_list),
>       ("poolid",       uint32),
> -    ("poolname",     string),
>       ])
>
>   libxl_domain_build_info = Struct("domain_build_info",[
> diff -r 4bb2b6a04ec0 -r c91bee33280d tools/libxl/xl_cmdimpl.c
> --- a/tools/libxl/xl_cmdimpl.c	Fri Jan 20 17:12:17 2012 +0000
> +++ b/tools/libxl/xl_cmdimpl.c	Mon Jan 23 14:35:46 2012 +0000
> @@ -315,7 +315,7 @@ static void printf_info(int domid,
>           printf("\t(uuid<unknown>)\n");
>       }
>
> -    printf("\t(cpupool %s)\n", c_info->poolname);
> +    printf("\t(cpupool %s)\n", libxl_cpupoolid_to_name(ctx, c_info->poolid));
>       if (c_info->xsdata)
>           printf("\t(xsdata contains data)\n");
>       else
> @@ -640,11 +640,9 @@ static void parse_config_data(const char
>           c_info->oos = l;
>
>       if (!xlu_cfg_get_string (config, "pool",&buf, 0)) {
> -        c_info->poolid = -1;
>           cpupool_qualifier_to_cpupoolid(buf,&c_info->poolid, NULL);
>       }
> -    c_info->poolname = libxl_cpupoolid_to_name(ctx, c_info->poolid);
> -    if (!c_info->poolname) {
> +    if (!libxl_cpupoolid_to_name(ctx, c_info->poolid)) {
>           fprintf(stderr, "Illegal pool specified\n");
>           exit(1);
>       }
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
>


-- 
Juergen Gross                 Principal Developer Operating Systems
PDG ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: juergen.gross@ts.fujitsu.com
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html

  reply	other threads:[~2012-01-24  7:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-23 14:43 [PATCH 0 of 3] libxl: tweak the cpupool interface slightly Ian Campbell
2012-01-23 14:43 ` [PATCH 1 of 3] libxl: remove libxl_domain_create_info.poolname Ian Campbell
2012-01-24  7:21   ` Juergen Gross [this message]
2012-01-25 16:54   ` Ian Campbell
2012-01-23 14:43 ` [PATCH 2 of 3] libxl: name libxl_create_cpupool consistent with other functions Ian Campbell
2012-01-24  7:21   ` Juergen Gross
2012-01-23 14:43 ` [PATCH 3 of 3] libxl: do not write/maintain "pool_name" in XenStore Ian Campbell
2012-01-24  8:07   ` Juergen Gross

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=4F1E5BE4.3010406@ts.fujitsu.com \
    --to=juergen.gross@ts.fujitsu.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@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.