All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: "Anthony PERARD" <anthony.perard@citrix.com>,
	"Jürgen Groß" <jgross@suse.com>,
	"Ian Jackson" <ian.jackson@eu.citrix.com>, "Wei Liu" <wl@xen.org>
Subject: [Xen-devel] [XEN PATCH for-4.13 v7 08/11] libxl: create: setdefault: Move physinfo into config_setdefault
Date: Wed, 23 Oct 2019 14:00:10 +0100	[thread overview]
Message-ID: <20191023130013.32382-9-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <20191023130013.32382-1-ian.jackson@eu.citrix.com>

No functional change.  This will let us refer to it in code we are
about to add to this function.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Wei Liu <wl@xen.org>
---
v2: New patch in this version of the series.
---
 tools/libxl/libxl_create.c   | 17 ++++++++---------
 tools/libxl/libxl_dm.c       |  7 ++++++-
 tools/libxl/libxl_internal.h |  3 ++-
 3 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index d65df7924d..0670ef90ed 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -28,15 +28,9 @@
 #include <xen-xsm/flask/flask.h>
 
 int libxl__domain_create_info_setdefault(libxl__gc *gc,
-                                         libxl_domain_create_info *c_info)
+                                         libxl_domain_create_info *c_info,
+                                         const libxl_physinfo *info)
 {
-    libxl_physinfo info[1];
-    int rc;
-
-    rc = libxl_get_physinfo(CTX, info);
-    if (rc)
-        return rc;
-
     if (!c_info->type) {
         LOG(ERROR, "domain type unspecified");
         return ERROR_INVAL;
@@ -915,6 +909,10 @@ int libxl__domain_config_setdefault(libxl__gc *gc,
     int ret;
     bool pod_enabled = false;
 
+    libxl_physinfo physinfo;
+    ret = libxl_get_physinfo(CTX, &physinfo);
+    if (ret) goto error_out;
+
     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),
@@ -1013,7 +1011,8 @@ int libxl__domain_config_setdefault(libxl__gc *gc,
         goto error_out;
     }
 
-    ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info);
+    ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info,
+                                               &physinfo);
     if (ret) {
         LOGD(ERROR, domid, "Unable to set domain create info defaults");
         goto error_out;
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index c00356a2f1..e6a48974f8 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -2167,7 +2167,12 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
     dm_config->c_info.run_hotplug_scripts =
         guest_config->c_info.run_hotplug_scripts;
 
-    ret = libxl__domain_create_info_setdefault(gc, &dm_config->c_info);
+    libxl_physinfo physinfo;
+    ret = libxl_get_physinfo(CTX, &physinfo);
+    if (ret) goto out;
+
+    ret = libxl__domain_create_info_setdefault(gc, &dm_config->c_info,
+                                               &physinfo);
     if (ret) goto out;
     ret = libxl__domain_build_info_setdefault(gc, &dm_config->b_info);
     if (ret) goto out;
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 0185b8ff01..6a614658c2 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1447,7 +1447,8 @@ _hidden int libxl__domain_config_setdefault(libxl__gc *gc,
                                             libxl_domain_config *d_config,
                                             uint32_t domid /* logging only */);
 _hidden int libxl__domain_create_info_setdefault(libxl__gc *gc,
-                                        libxl_domain_create_info *c_info);
+                                        libxl_domain_create_info *c_info,
+                                        const libxl_physinfo *info);
 _hidden int libxl__domain_build_info_setdefault(libxl__gc *gc,
                                         libxl_domain_build_info *b_info);
 _hidden void libxl__rdm_setdefault(libxl__gc *gc,
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-10-23 13:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23 13:00 [Xen-devel] [XEN PATCH for-4.13 v7 00/11] libxl memkb & pt defaulting Ian Jackson
2019-10-23 13:00 ` [Xen-devel] [XEN PATCH for-4.13 v7 01/11] libxl: Offer API versions 0x040700 and 0x040800 Ian Jackson
2019-10-23 13:39   ` Jürgen Groß
2020-10-26 16:42   ` Olaf Hering
2020-10-26 16:48     ` Jan Beulich
2019-10-23 13:00 ` [Xen-devel] [XEN PATCH for-4.13 v7 02/11] xl: Pass libxl_domain_config to freemem(), instead of b_info Ian Jackson
2019-10-23 13:39   ` Jürgen Groß
2019-10-23 13:00 ` [Xen-devel] [XEN PATCH for-4.13 v7 03/11] libxl: libxl__domain_config_setdefault: New function Ian Jackson
2019-10-23 13:40   ` Jürgen Groß
2019-10-23 13:00 ` [Xen-devel] [XEN PATCH for-4.13 v7 04/11] libxl: libxl_domain_need_memory: Make it take a domain_config Ian Jackson
2019-10-23 13:41   ` Jürgen Groß
2019-10-23 13:00 ` [Xen-devel] [XEN PATCH for-4.13 v7 05/11] libxl: Move shadow_memkb and iommu_memkb defaulting into libxl Ian Jackson
2019-10-23 13:42   ` Jürgen Groß
2019-10-23 13:00 ` [Xen-devel] [XEN PATCH for-4.13 v7 06/11] libxl: Remove/deprecate libxl_get_required_*_memory from the API Ian Jackson
2019-10-23 13:42   ` Jürgen Groß
2019-10-23 13:00 ` [Xen-devel] [XEN PATCH for-4.13 v7 07/11] libxl: create: setdefault: Make libxl_physinfo info[1] Ian Jackson
2019-10-23 13:43   ` Jürgen Groß
2019-10-23 13:00 ` Ian Jackson [this message]
2019-10-23 13:43   ` [Xen-devel] [XEN PATCH for-4.13 v7 08/11] libxl: create: setdefault: Move physinfo into config_setdefault Jürgen Groß
2019-10-23 13:00 ` [Xen-devel] [XEN PATCH for-4.13 v7 09/11] libxl: Move domain_create_info_setdefault earlier Ian Jackson
2019-10-23 13:44   ` Jürgen Groß
2019-10-23 13:00 ` [Xen-devel] [XEN PATCH for-4.13 v7 10/11] libxl/xl: Overhaul passthrough setting logic Ian Jackson
2019-10-23 13:45   ` Jürgen Groß
2019-10-23 14:22   ` Anthony PERARD
2019-10-23 13:00 ` [Xen-devel] [XEN PATCH for-4.13 v7 11/11] libxl: On ARM, reject future new passthrough modes too Ian Jackson
2019-10-23 13:45   ` Jürgen Groß
2019-10-23 15:40   ` Anthony PERARD
2019-10-23 15:48     ` Ian Jackson
2019-10-24 15:08     ` Ian Jackson

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=20191023130013.32382-9-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=anthony.perard@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.