From: "Roger Pau Monné" <roger.pau@citrix.com> To: Olaf Hering <olaf@aepfle.de> Cc: xen-devel@lists.xenproject.org, Wei Liu <wei.liu2@citrix.com>, Ian Jackson <ian.jackson@eu.citrix.com> Subject: Re: [PATCH v1] libxl: add helper function to set device_model_version Date: Tue, 14 May 2019 12:18:56 +0200 [thread overview] Message-ID: <20190514101856.6otetd56n72t42bm@Air-de-Roger> (raw) In-Reply-To: <20190514072741.11760-1-olaf@aepfle.de> On Tue, May 14, 2019 at 09:27:41AM +0200, Olaf Hering wrote: > An upcoming change will set the value of device_model_version properly > also for the non-HVM case. > > Move existing code to new function libxl__domain_set_device_model. > Move also initialization for device_model_stubdomain to that function. > Make sure libxl__domain_build_info_setdefault is called with > device_model_version set. > > Update libxl__spawn_stub_dm() and initiate_domain_create() to call the > new function prior libxl__domain_build_info_setdefault() because > device_mode_version is expected to be initialzed. That's all fine, but this just describes the changes performed below without providing a reasoning on why those changes are needed. Why is it not fine to set the device model version in libxl__domain_build_info_setdefault? > @@ -938,6 +952,12 @@ static void initiate_domain_create(libxl__egc *egc, > goto error_out; > } > > + ret = libxl__domain_set_device_model(gc, d_config); > + if (ret) { > + LOGD(ERROR, domid, "Unable to set domain device model"); > + goto error_out; > + } Can you place the call to libxl__domain_set_device_model at the top (or a suitable place) of libxl__domain_build_info_setdefault instead of adding a call in initiate_domain_create? > + > ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info); > if (ret) { > LOGD(ERROR, domid, "Unable to set domain create info defaults"); > diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c > index 2f19786bdd..086e566311 100644 > --- a/tools/libxl/libxl_dm.c > +++ b/tools/libxl/libxl_dm.c > @@ -2168,6 +2168,8 @@ 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_set_device_model(gc, dm_config); > + if (ret) goto out; > ret = libxl__domain_create_info_setdefault(gc, &dm_config->c_info); > if (ret) goto out; > ret = libxl__domain_build_info_setdefault(gc, &dm_config->b_info); Same here, AFAICT the call to libxl__domain_set_device_model could be placed inside of libxl__domain_build_info_setdefault? Thanks, Roger. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
WARNING: multiple messages have this Message-ID (diff)
From: "Roger Pau Monné" <roger.pau@citrix.com> To: Olaf Hering <olaf@aepfle.de> Cc: xen-devel@lists.xenproject.org, Wei Liu <wei.liu2@citrix.com>, Ian Jackson <ian.jackson@eu.citrix.com> Subject: Re: [Xen-devel] [PATCH v1] libxl: add helper function to set device_model_version Date: Tue, 14 May 2019 12:18:56 +0200 [thread overview] Message-ID: <20190514101856.6otetd56n72t42bm@Air-de-Roger> (raw) Message-ID: <20190514101856.U2ZlB2CpmJnRKTu_ruUkVeCsI8DafV0rgBy6tGZFBpU@z> (raw) In-Reply-To: <20190514072741.11760-1-olaf@aepfle.de> On Tue, May 14, 2019 at 09:27:41AM +0200, Olaf Hering wrote: > An upcoming change will set the value of device_model_version properly > also for the non-HVM case. > > Move existing code to new function libxl__domain_set_device_model. > Move also initialization for device_model_stubdomain to that function. > Make sure libxl__domain_build_info_setdefault is called with > device_model_version set. > > Update libxl__spawn_stub_dm() and initiate_domain_create() to call the > new function prior libxl__domain_build_info_setdefault() because > device_mode_version is expected to be initialzed. That's all fine, but this just describes the changes performed below without providing a reasoning on why those changes are needed. Why is it not fine to set the device model version in libxl__domain_build_info_setdefault? > @@ -938,6 +952,12 @@ static void initiate_domain_create(libxl__egc *egc, > goto error_out; > } > > + ret = libxl__domain_set_device_model(gc, d_config); > + if (ret) { > + LOGD(ERROR, domid, "Unable to set domain device model"); > + goto error_out; > + } Can you place the call to libxl__domain_set_device_model at the top (or a suitable place) of libxl__domain_build_info_setdefault instead of adding a call in initiate_domain_create? > + > ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info); > if (ret) { > LOGD(ERROR, domid, "Unable to set domain create info defaults"); > diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c > index 2f19786bdd..086e566311 100644 > --- a/tools/libxl/libxl_dm.c > +++ b/tools/libxl/libxl_dm.c > @@ -2168,6 +2168,8 @@ 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_set_device_model(gc, dm_config); > + if (ret) goto out; > ret = libxl__domain_create_info_setdefault(gc, &dm_config->c_info); > if (ret) goto out; > ret = libxl__domain_build_info_setdefault(gc, &dm_config->b_info); Same here, AFAICT the call to libxl__domain_set_device_model could be placed inside of libxl__domain_build_info_setdefault? Thanks, Roger. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-05-14 10:19 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-05-14 7:27 [PATCH v1] libxl: add helper function to set device_model_version Olaf Hering 2019-05-14 7:27 ` [Xen-devel] " Olaf Hering 2019-05-14 10:18 ` Roger Pau Monné [this message] 2019-05-14 10:18 ` Roger Pau Monné 2019-05-14 10:31 ` Olaf Hering 2019-05-14 10:31 ` [Xen-devel] " Olaf Hering 2019-05-14 10:39 ` Roger Pau Monné 2019-05-14 10:39 ` [Xen-devel] " Roger Pau Monné 2019-05-14 14:32 ` Wei Liu 2019-05-14 14:32 ` [Xen-devel] " Wei Liu 2019-05-15 9:13 ` Olaf Hering 2019-05-15 9:13 ` [Xen-devel] " Olaf Hering
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=20190514101856.6otetd56n72t42bm@Air-de-Roger \ --to=roger.pau@citrix.com \ --cc=ian.jackson@eu.citrix.com \ --cc=olaf@aepfle.de \ --cc=wei.liu2@citrix.com \ --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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).