diff mbox series

[kvm-unit-tests,GIT,PULL,06/28] lib: s390x: hardware: Add host_is_qemu() function

Message ID 20220512093523.36132-7-imbrenda@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series storage keys, attestation, migration tests | expand

Commit Message

Claudio Imbrenda May 12, 2022, 9:35 a.m. UTC
From: Janosch Frank <frankja@linux.ibm.com>

In the future we'll likely need to check if we're hosted on QEMU so
let's make this as easy as possible by providing a dedicated function.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Nico Boehr <nrb@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
---
 lib/s390x/hardware.h | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/lib/s390x/hardware.h b/lib/s390x/hardware.h
index 01eeb261..86fe873c 100644
--- a/lib/s390x/hardware.h
+++ b/lib/s390x/hardware.h
@@ -45,6 +45,11 @@  static inline bool host_is_lpar(void)
 	return detect_host() == HOST_IS_LPAR;
 }
 
+static inline bool host_is_qemu(void)
+{
+	return host_is_tcg() || host_is_kvm();
+}
+
 static inline bool machine_is_z15(void)
 {
 	uint16_t machine = get_machine_id();