From: Anthony PERARD <anthony.perard@citrix.com>
To: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: "Jürgen Groß" <jgross@suse.com>,
xen-devel@lists.xenproject.org, "Wei Liu" <wl@xen.org>
Subject: Re: [Xen-devel] [XEN PATCH for-4.13 3/6] libxl: libxl__domain_config_setdefault: New function
Date: Fri, 4 Oct 2019 16:53:49 +0100 [thread overview]
Message-ID: <20191004155349.GM1163@perard.uk.xensource.com> (raw)
In-Reply-To: <20191004151707.24844-4-ian.jackson@eu.citrix.com>
On Fri, Oct 04, 2019 at 04:17:04PM +0100, Ian Jackson wrote:
> Break out this into a new function. We are going to want to call it
> from a new call site.
>
> Unfortunately not all of the defaults can be moved into the new
> function without changing the order in which things are done. That
> does not seem wise at this stage of the release. The effect is that
> additional calls to libxl__domain_config_setdefault (which are going
> to be introduced) do not quite set everything. But they will do what
> is needed. After Xen 4.13 is done, we should move those settings into
> the right order.
>
> No functional change.
>
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
> ---
> tools/libxl/libxl_create.c | 40 ++++++++++++++++++++++++++++------------
> tools/libxl/libxl_internal.h | 3 +++
> 2 files changed, 31 insertions(+), 12 deletions(-)
>
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index 099761a2d7..457beb6462 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -862,22 +862,14 @@ static void domcreate_destruction_cb(libxl__egc *egc,
> libxl__domain_destroy_state *dds,
> int rc);
>
> -static void initiate_domain_create(libxl__egc *egc,
> - libxl__domain_create_state *dcs)
> +int libxl__domain_config_setdefault(libxl__gc *gc,
> + libxl_domain_config *d_config,
> + uint32_t domid)
> {
> - STATE_AO_GC(dcs->ao);
> libxl_ctx *ctx = libxl__gc_owner(gc);
> - uint32_t domid;
> - int i, ret;
> + int ret;
> bool pod_enabled = false;
>
> - /* convenience aliases */
> - libxl_domain_config *const d_config = dcs->guest_config;
> - const int restore_fd = dcs->restore_fd;
> -
> - domid = dcs->domid_soft_reset;
> - libxl__domain_build_state_init(&dcs->build_state);
> -
> if (d_config->c_info.ssid_label) {
> char *s = d_config->c_info.ssid_label;
> ret = libxl_flask_context_to_sid(ctx, s, strlen(s),
> @@ -1008,6 +1000,27 @@ static void initiate_domain_create(libxl__egc *egc,
> goto error_out;
> }
>
> + ret = 0;
> + error_out:
> + return ret;
> +}
> +
> +static void initiate_domain_create(libxl__egc *egc,
> + libxl__domain_create_state *dcs)
> +{
> + STATE_AO_GC(dcs->ao);
> + uint32_t domid;
> + int i, ret;
> +
> + /* convenience aliases */
> + libxl_domain_config *const d_config = dcs->guest_config;
> + const int restore_fd = dcs->restore_fd;
> +
> + domid = dcs->domid_soft_reset;
> + libxl__domain_build_state_init(&dcs->build_state);
> +
> + libxl__domain_config_setdefault(gc,d_config,domid);
Shouldn't you check for error ?
Thanks,
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-10-04 15:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-04 15:17 [Xen-devel] [XEN PATCH for-4.13 0/6] Drop/deprecate libxl_get_required_*_memory Ian Jackson
2019-10-04 15:17 ` [Xen-devel] [XEN PATCH for-4.13 1/6] libxl: Offer API versions 0x040700 and 0x040800 Ian Jackson
2019-10-04 15:33 ` Anthony PERARD
2019-10-04 16:08 ` Ian Jackson
2019-10-04 15:17 ` [Xen-devel] [XEN PATCH for-4.13 2/6] xl: Pass libxl_domain_config to freemem(), instead of b_info Ian Jackson
2019-10-04 17:24 ` Anthony PERARD
2019-10-04 15:17 ` [Xen-devel] [XEN PATCH for-4.13 3/6] libxl: libxl__domain_config_setdefault: New function Ian Jackson
2019-10-04 15:53 ` Anthony PERARD [this message]
2019-10-04 16:04 ` Ian Jackson
2019-10-04 17:25 ` Anthony PERARD
2019-10-07 9:57 ` Ian Jackson
2019-10-04 15:17 ` [Xen-devel] [XEN PATCH for-4.13 4/6] libxl: libxl_domain_need_memory: Make it take a domain_config Ian Jackson
2019-10-04 16:19 ` Anthony PERARD
2019-10-04 15:17 ` [Xen-devel] [XEN PATCH for-4.13 5/6] libxl: Move shadow_memkb and iommu_memkb defaulting into libxl Ian Jackson
2019-10-04 17:19 ` Anthony PERARD
2019-10-04 17:23 ` Ian Jackson
2019-10-04 15:17 ` [Xen-devel] [XEN PATCH for-4.13 6/6] libxl: Remove/deprecate libxl_get_required_*_memory from the API Ian Jackson
2019-10-04 17:24 ` Anthony PERARD
2019-10-07 6:45 ` [Xen-devel] [XEN PATCH for-4.13 0/6] Drop/deprecate libxl_get_required_*_memory Jürgen Groß
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=20191004155349.GM1163@perard.uk.xensource.com \
--to=anthony.perard@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jgross@suse.com \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.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.