]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
libxl: On ARM, reject future new passthrough modes too
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 23 Oct 2019 12:55:54 +0000 (13:55 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Thu, 24 Oct 2019 15:08:41 +0000 (16:08 +0100)
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>
tools/libxl/libxl_arm.c

index 2f1ca694317954fc35f7fab4dc0fa3ef58cda565..34f8a29056db48b57e4fe3582ce72589f0def5fd 100644 (file)
@@ -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;
     }