diff mbox series

hvf: Report HV_DENIED error

Message ID 20230601142704.68768-1-quic_acaggian@quicinc.com
State New
Headers show
Series hvf: Report HV_DENIED error | expand

Commit Message

Antonio Caggiano June 1, 2023, 2:27 p.m. UTC
In case the resulting binary is not signed with the proper entitlement,
handle and report the HV_DENIED error.

Signed-off-by: Antonio Caggiano <quic_acaggian@quicinc.com>
---
 accel/hvf/hvf-all.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Peter Maydell June 1, 2023, 2:56 p.m. UTC | #1
On Thu, 1 Jun 2023 at 15:27, Antonio Caggiano <quic_acaggian@quicinc.com> wrote:
>
> In case the resulting binary is not signed with the proper entitlement,
> handle and report the HV_DENIED error.
>
> Signed-off-by: Antonio Caggiano <quic_acaggian@quicinc.com>
> ---
>  accel/hvf/hvf-all.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c
> index 0043f4d308..679907a147 100644
> --- a/accel/hvf/hvf-all.c
> +++ b/accel/hvf/hvf-all.c
> @@ -38,6 +38,9 @@ void assert_hvf_ok(hv_return_t ret)
>      case HV_UNSUPPORTED:
>          error_report("Error: HV_UNSUPPORTED");
>          break;
> +    case HV_DENIED:
> +        error_report("Error: HV_DENIED");
> +        break;
>      default:
>          error_report("Unknown Error");
>      }

HV_DENIED only appeared in macos 11, so this will break
the build on Catalina (10.15). Catalina isn't in our official
list of supported versions any more (too old) so we don't
strictly have to support it, but is it easy to add some
kind of ifdef so we don't break it just yet ?

thanks
-- PMM
diff mbox series

Patch

diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c
index 0043f4d308..679907a147 100644
--- a/accel/hvf/hvf-all.c
+++ b/accel/hvf/hvf-all.c
@@ -38,6 +38,9 @@  void assert_hvf_ok(hv_return_t ret)
     case HV_UNSUPPORTED:
         error_report("Error: HV_UNSUPPORTED");
         break;
+    case HV_DENIED:
+        error_report("Error: HV_DENIED");
+        break;
     default:
         error_report("Unknown Error");
     }