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

Suggested-by: Julien Grall <jul...@xen.org>
CC: Julien Grall <jul...@xen.org>
CC: Stefano Stabellini <sstabell...@kernel.org>
Signed-off-by: Ian Jackson <ian.jack...@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;
+    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;
     }
-- 
2.11.0


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

Reply via email to