diff mbox series

[for-4.14] tools/libxl: fix setting altp2m param broken by 1e9bc407cf0

Message ID 20200529160621.3123-1-tamas@tklengyel.com (mailing list archive)
State Superseded
Headers show
Series [for-4.14] tools/libxl: fix setting altp2m param broken by 1e9bc407cf0 | expand

Commit Message

Tamas K Lengyel May 29, 2020, 4:06 p.m. UTC
The patch 1e9bc407cf0 mistakenly converted the altp2m config option to a
boolean. This is incorrect and breaks external-only usecases of altp2m that
is set with a value of 2.

Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 tools/libxl/libxl_x86.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Andrew Cooper May 29, 2020, 4:15 p.m. UTC | #1
On 29/05/2020 17:06, Tamas K Lengyel wrote:
> The patch 1e9bc407cf0 mistakenly converted the altp2m config option to a
> boolean. This is incorrect and breaks external-only usecases of altp2m that
> is set with a value of 2.
>
> Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>

Urg yes.  Sorry.

However, this doesn't build because there is another use of the altp2m
variable between the two hunks below, for compatiblity with the older
altp2mhvm option.

I think changing its type just to int out to suffice?

~Andrew

> ---
>  tools/libxl/libxl_x86.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
> index f8bc828e62..272736850b 100644
> --- a/tools/libxl/libxl_x86.c
> +++ b/tools/libxl/libxl_x86.c
> @@ -391,7 +391,6 @@ static int hvm_set_conf_params(libxl__gc *gc, uint32_t domid,
>      libxl_ctx *ctx = libxl__gc_owner(gc);
>      xc_interface *xch = ctx->xch;
>      int ret = ERROR_FAIL;
> -    bool altp2m = info->altp2m;
>  
>      switch(info->type) {
>      case LIBXL_DOMAIN_TYPE_HVM:
> @@ -433,7 +432,7 @@ static int hvm_set_conf_params(libxl__gc *gc, uint32_t domid,
>              LOG(ERROR, "Couldn't set HVM_PARAM_NESTEDHVM");
>              goto out;
>          }
> -        if (xc_hvm_param_set(xch, domid, HVM_PARAM_ALTP2M, altp2m)) {
> +        if (xc_hvm_param_set(xch, domid, HVM_PARAM_ALTP2M, info->altp2m)) {
>              LOG(ERROR, "Couldn't set HVM_PARAM_ALTP2M");
>              goto out;
>          }
Tamas K Lengyel May 29, 2020, 4:17 p.m. UTC | #2
On Fri, May 29, 2020 at 10:15 AM Andrew Cooper
<andrew.cooper3@citrix.com> wrote:
>
> On 29/05/2020 17:06, Tamas K Lengyel wrote:
> > The patch 1e9bc407cf0 mistakenly converted the altp2m config option to a
> > boolean. This is incorrect and breaks external-only usecases of altp2m that
> > is set with a value of 2.
> >
> > Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
>
> Urg yes.  Sorry.
>
> However, this doesn't build because there is another use of the altp2m
> variable between the two hunks below, for compatiblity with the older
> altp2mhvm option.

Eh, so much for hastily sending a patch with last minute changes.

>
> I think changing its type just to int out to suffice?

Indeed, that would work as well. Let me just resend with that.

Tamas
diff mbox series

Patch

diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index f8bc828e62..272736850b 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -391,7 +391,6 @@  static int hvm_set_conf_params(libxl__gc *gc, uint32_t domid,
     libxl_ctx *ctx = libxl__gc_owner(gc);
     xc_interface *xch = ctx->xch;
     int ret = ERROR_FAIL;
-    bool altp2m = info->altp2m;
 
     switch(info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
@@ -433,7 +432,7 @@  static int hvm_set_conf_params(libxl__gc *gc, uint32_t domid,
             LOG(ERROR, "Couldn't set HVM_PARAM_NESTEDHVM");
             goto out;
         }
-        if (xc_hvm_param_set(xch, domid, HVM_PARAM_ALTP2M, altp2m)) {
+        if (xc_hvm_param_set(xch, domid, HVM_PARAM_ALTP2M, info->altp2m)) {
             LOG(ERROR, "Couldn't set HVM_PARAM_ALTP2M");
             goto out;
         }