summaryrefslogtreecommitdiffstats
path: root/include/glib-compat.h
diff options
context:
space:
mode:
authorPeter Maydell2021-05-06 19:56:17 +0200
committerPeter Maydell2021-05-06 19:56:17 +0200
commit4cc10cae64c51e17844dc4358481c393d7bf1ed4 (patch)
tree7fa52caea4e82de5a71e65f1769ebe90780ddd33 /include/glib-compat.h
parentMerge remote-tracking branch 'remotes/dg-gitlab/tags/ppc-for-6.1-20210504' in... (diff)
parentglib-compat: accept G_TEST_SLOW environment variable (diff)
downloadqemu-4cc10cae64c51e17844dc4358481c393d7bf1ed4.tar.gz
qemu-4cc10cae64c51e17844dc4358481c393d7bf1ed4.tar.xz
qemu-4cc10cae64c51e17844dc4358481c393d7bf1ed4.zip
Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging
* NetBSD NVMM support * RateLimit mutex * Prepare for Meson 0.57 upgrade # gpg: Signature made Tue 04 May 2021 13:15:37 BST # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini-gitlab/tags/for-upstream: glib-compat: accept G_TEST_SLOW environment variable gitlab-ci: use --meson=internal for CFI jobs configure: handle meson options that have changed type configure: reindent meson invocation slirp: add configure option to disable smbd ratelimit: protect with a mutex Add NVMM Accelerator: add maintainers for NetBSD/NVMM Add NVMM accelerator: acceleration enlightenments Add NVMM accelerator: x86 CPU support Add NVMM accelerator: configure and build logic oslib-win32: do not rely on macro to get redefined function name Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/glib-compat.h')
-rw-r--r--include/glib-compat.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/glib-compat.h b/include/glib-compat.h
index 695a96f7ea..4542e920d5 100644
--- a/include/glib-compat.h
+++ b/include/glib-compat.h
@@ -100,6 +100,23 @@ g_unix_get_passwd_entry_qemu(const gchar *user_name, GError **error)
}
#endif /* G_OS_UNIX */
+static inline bool
+qemu_g_test_slow(void)
+{
+ static int cached = -1;
+ if (cached == -1) {
+ cached = g_test_slow() || getenv("G_TEST_SLOW") != NULL;
+ }
+ return cached;
+}
+
+#undef g_test_slow
+#undef g_test_thorough
+#undef g_test_quick
+#define g_test_slow() qemu_g_test_slow()
+#define g_test_thorough() qemu_g_test_slow()
+#define g_test_quick() (!qemu_g_test_slow())
+
#pragma GCC diagnostic pop
#endif