qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2] hvf: Report HV_DENIED error


From: Antonio Caggiano
Subject: [PATCH v2] hvf: Report HV_DENIED error
Date: Wed, 7 Jun 2023 10:55:55 +0200

On MacOS 11 and subsequent versions, 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>
---
v2: Use architecture specific defines from AvailabilityMacros.h to enable the
    HV_DENIED case only on MacOS 11 and subsequent versions.

 accel/hvf/hvf-all.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c
index 754707dbfb..1eacfc6a95 100644
--- a/accel/hvf/hvf-all.c
+++ b/accel/hvf/hvf-all.c
@@ -38,6 +38,11 @@ void assert_hvf_ok(hv_return_t ret)
     case HV_UNSUPPORTED:
         error_report("Error: HV_UNSUPPORTED");
         break;
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_VERSION_11_0
+    case HV_DENIED:
+        error_report("Error: HV_DENIED");
+        break;
+#endif
     default:
         error_report("Unknown Error");
     }
-- 
2.40.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]