diff mbox series

[kvm-unit-tests,v2,7/8] s390x: uv-host: Fence against being run as a PV guest

Message ID 20220706064024.16573-8-frankja@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series s390x: uv-host: Access check extensions and improvements | expand

Commit Message

Janosch Frank July 6, 2022, 6:40 a.m. UTC
This test checks the UV host API so we should skip it if we're a PV
guest.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
 s390x/uv-host.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Steffen Eiden July 8, 2022, 10:08 a.m. UTC | #1
On 7/6/22 08:40, Janosch Frank wrote:
> This test checks the UV host API so we should skip it if we're a PV
> guest.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
> ---
>   s390x/uv-host.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/s390x/uv-host.c b/s390x/uv-host.c
> index af3122a8..1ed8ded1 100644
> --- a/s390x/uv-host.c
> +++ b/s390x/uv-host.c
> @@ -695,6 +695,10 @@ int main(void)
>   		report_skip("Ultravisor call facility is not available");
>   		goto done;
>   	}
> +	if (!uv_os_is_host()) {
> +		report_skip("This test needs to be run in a UV host environment");
> +		goto done;
> +	}
>   
>   	test_i3();
>   	test_priv();
diff mbox series

Patch

diff --git a/s390x/uv-host.c b/s390x/uv-host.c
index af3122a8..1ed8ded1 100644
--- a/s390x/uv-host.c
+++ b/s390x/uv-host.c
@@ -695,6 +695,10 @@  int main(void)
 		report_skip("Ultravisor call facility is not available");
 		goto done;
 	}
+	if (!uv_os_is_host()) {
+		report_skip("This test needs to be run in a UV host environment");
+		goto done;
+	}
 
 	test_i3();
 	test_priv();