From: Julien Grall <julien.grall@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>,
Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Sahita, Ravi" <ravi.sahita@intel.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>,
Ed White <edmund.h.white@intel.com>
Subject: Re: [PATCH] libxl: check nesthvm and altp2m in libxl level
Date: Mon, 27 Jul 2015 13:34:04 +0100 [thread overview]
Message-ID: <55B6253C.9080301@citrix.com> (raw)
In-Reply-To: <1437752378-14603-1-git-send-email-wei.liu2@citrix.com>
Hi Wei,
On 24/07/15 16:39, Wei Liu wrote:
> In ea214001 ("x86/altp2m: add altp2mhvm HVM domain parameter"), a
> check was added to ensure nestedhvm and altp2m cannot be enabled at
> the same time. That check was added in xl, but in fact it should be in
> libxl because it should be the entity that decides whether
> the provided configuration is valid.
>
> This patch moves the check to libxl. The code snippet is moved after
> calling libxl__domain_build_info_setdefault so that we can:
> 1. remove libxl_defbool_is_default in `if()';
> 2. detect mistake in libxl__domain_build_info_setdefault.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
> Cc: Ed White <edmund.h.white@intel.com>
> Cc: "Sahita, Ravi" <ravi.sahita@intel.com>
>
> I said I discovered an issue during review but also volunteered to fix
> it after the series is merged. Here is the patch to do that.
> ---
> tools/libxl/libxl_create.c | 6 ++++++
> tools/libxl/xl_cmdimpl.c | 8 --------
> 2 files changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index 855b42c..de536ba 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -883,6 +883,12 @@ static void initiate_domain_create(libxl__egc *egc,
> goto error_out;
> }
>
> + if (libxl_defbool_val(d_config->b_info.u.hvm.nested_hvm) &&
> + libxl_defbool_val(d_config->b_info.u.hvm.altp2m)) {
> + LOG(ERROR, "nestedhvm and altp2mhvm cannot be used together");
> + goto error_out;
> + }
> +
The u.hvm.{nested_hvm,altp2m} can only be checked when the created
domain is an HVM.
But initiate_domain_create is called with either a PV or HVM domain. So
you may need to check if we are creating a HVM one.
Regards,
--
Julien Grall
next prev parent reply other threads:[~2015-07-27 12:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-24 15:39 [PATCH] libxl: check nesthvm and altp2m in libxl level Wei Liu
2015-07-24 16:02 ` Sahita, Ravi
2015-07-27 12:34 ` Julien Grall [this message]
2015-07-27 13:26 ` 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=55B6253C.9080301@citrix.com \
--to=julien.grall@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=edmund.h.white@intel.com \
--cc=ian.campbell@citrix.com \
--cc=ravi.sahita@intel.com \
--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: 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.