diff mbox series

[XEN,for-4.13,v7,11/11] libxl: On ARM, reject future new passthrough modes too

Message ID 20191023130013.32382-12-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series libxl memkb & pt defaulting | expand

Commit Message

Ian Jackson Oct. 23, 2019, 1 p.m. UTC
This is most pleasantly done by also changing the if to a switch.

Suggested-by: Julien Grall <julien@xen.org>
CC: Julien Grall <julien@xen.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

---
v7: New patch in this version of the series.
---
 tools/libxl/libxl_arm.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Jürgen Groß Oct. 23, 2019, 1:45 p.m. UTC | #1
On 23.10.19 15:00, Ian Jackson wrote:
> This is most pleasantly done by also changing the if to a switch.
> 
> Suggested-by: Julien Grall <julien@xen.org>
> CC: Julien Grall <julien@xen.org>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

Release-acked-by: Juergen Gross <jgross@suse.com>


Juergen
Anthony PERARD Oct. 23, 2019, 3:40 p.m. UTC | #2
On Wed, Oct 23, 2019 at 02:00:13PM +0100, Ian Jackson wrote:
> This is most pleasantly done by also changing the if to a switch.
> 
> Suggested-by: Julien Grall <julien@xen.org>
> CC: Julien Grall <julien@xen.org>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
> 
> ---
> v7: New patch in this version of the series.
> ---
>  tools/libxl/libxl_arm.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
> index 2f1ca69431..0b3025a9ed 100644
> --- a/tools/libxl/libxl_arm.c
> +++ b/tools/libxl/libxl_arm.c
> @@ -1203,9 +1203,15 @@ int libxl__arch_passthrough_mode_setdefault(libxl__gc *gc,
>          c_info->passthrough = LIBXL_PASSTHROUGH_SHARE_PT;
>      }
>  
> -    if (c_info->passthrough == LIBXL_PASSTHROUGH_SYNC_PT) {
> +    switch (c_info->passthrough) {
> +    case LIBXL_PASSTHROUGH_DISABLED;

That looks strange, there a semicolon ^ here instead of a colon ':'.

> +    case LIBXL_PASSTHROUGH_SHARE_PT:
> +        break;
> +
> +    default:
>          LOGD(ERROR, domid,
> -             "passthrough=\"sync_pt\" not supported on ARM\n");
> +             "passthrough=\"%s\" not supported on ARM\n",
> +             libxl__passthrough_mode_to_string(c_info->passthrough);

I can't find where this function is defined. Does it exist?
You probably want libxl_passthrough_to_string().
Also there's a missing ) to terminate LOGD list of args.

I think that's it. With those 3 things fixed:
Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Cheers,
Ian Jackson Oct. 23, 2019, 3:48 p.m. UTC | #3
Anthony PERARD writes ("Re: [XEN PATCH for-4.13 v7 11/11] libxl: On ARM, reject future new passthrough modes too"):
> On Wed, Oct 23, 2019 at 02:00:13PM +0100, Ian Jackson wrote:
> > -    if (c_info->passthrough == LIBXL_PASSTHROUGH_SYNC_PT) {
> > +    switch (c_info->passthrough) {
> > +    case LIBXL_PASSTHROUGH_DISABLED;
> 
> That looks strange, there a semicolon ^ here instead of a colon ':'.

Damn, I'm an idiot.  I build tested this on x86.

I will find somewhere to build test it on ARM.

Thanks for the review.

Ian.
Ian Jackson Oct. 24, 2019, 3:08 p.m. UTC | #4
Anthony PERARD writes ("Re: [XEN PATCH for-4.13 v7 11/11] libxl: On ARM, reject future new passthrough modes too"):
> On Wed, Oct 23, 2019 at 02:00:13PM +0100, Ian Jackson wrote:
> > +    case LIBXL_PASSTHROUGH_DISABLED;
> 
> That looks strange, there a semicolon ^ here instead of a colon ':'.
> 
> > -             "passthrough=\"sync_pt\" not supported on ARM\n");
> > +             "passthrough=\"%s\" not supported on ARM\n",
> > +             libxl__passthrough_mode_to_string(c_info->passthrough);
> 
> I can't find where this function is defined. Does it exist?
> You probably want libxl_passthrough_to_string().
> Also there's a missing ) to terminate LOGD list of args.

I managed to get osstest to let me have one of its arm boxes for long
enough to actually build test this and your list of issues was
comprehensive.

> I think that's it. With those 3 things fixed:
> Acked-by: Anthony PERARD <anthony.perard@citrix.com>

So, thanks.  FTR here is the final version.

This now has all the required acks and I will build test it again
against staging and push it.

Ian.

From 324f7b4092da65dae6aec978a89966b8ecff3a9d Mon Sep 17 00:00:00 2001
From: Ian Jackson <ian.jackson@eu.citrix.com>
Date: Wed, 23 Oct 2019 13:55:54 +0100
Subject: [XEN PATCH for-4.13 v7 11/11] libxl: On ARM, reject future new
 passthrough modes too
Cc: Jürgen Groß <jgross@suse.com>

This is most pleasantly done by also changing the if to a switch.

Suggested-by: Julien Grall <julien@xen.org>
CC: Julien Grall <julien@xen.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>

---
v8: Fix many idioticy compile errors in this patch.

v7: New patch in this version of the series.
---
 tools/libxl/libxl_arm.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index 2f1ca69431..34f8a29056 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -1203,9 +1203,15 @@ int libxl__arch_passthrough_mode_setdefault(libxl__gc *gc,
         c_info->passthrough = LIBXL_PASSTHROUGH_SHARE_PT;
     }
 
-    if (c_info->passthrough == LIBXL_PASSTHROUGH_SYNC_PT) {
+    switch (c_info->passthrough) {
+    case LIBXL_PASSTHROUGH_DISABLED:
+    case LIBXL_PASSTHROUGH_SHARE_PT:
+        break;
+
+    default:
         LOGD(ERROR, domid,
-             "passthrough=\"sync_pt\" not supported on ARM\n");
+             "passthrough=\"%s\" not supported on ARM\n",
+             libxl_passthrough_to_string(c_info->passthrough));
         rc = ERROR_INVAL;
         goto out;
     }
diff mbox series

Patch

diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index 2f1ca69431..0b3025a9ed 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -1203,9 +1203,15 @@  int libxl__arch_passthrough_mode_setdefault(libxl__gc *gc,
         c_info->passthrough = LIBXL_PASSTHROUGH_SHARE_PT;
     }
 
-    if (c_info->passthrough == LIBXL_PASSTHROUGH_SYNC_PT) {
+    switch (c_info->passthrough) {
+    case LIBXL_PASSTHROUGH_DISABLED;
+    case LIBXL_PASSTHROUGH_SHARE_PT:
+        break;
+
+    default:
         LOGD(ERROR, domid,
-             "passthrough=\"sync_pt\" not supported on ARM\n");
+             "passthrough=\"%s\" not supported on ARM\n",
+             libxl__passthrough_mode_to_string(c_info->passthrough);
         rc = ERROR_INVAL;
         goto out;
     }