qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tests/qtest/migration-test: Run the dirty ring tests only with the x86 target
@ 2022-08-01 11:46 Thomas Huth
  2022-08-01 14:29 ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Huth @ 2022-08-01 11:46 UTC (permalink / raw)
  To: Dr. David Alan Gilbert, Juan Quintela, qemu-devel
  Cc: Laurent Vivier, Peter Maydell, Hyman Huang, peterx

kvm_dirty_ring_supported() only checks whether the dirty ring support
is available on the x86 host, but it ignores whether the target QEMU
architecture is x86 or not. Thus the test_vcpu_dirty_limit() test
currently fails with the assert((strcmp(arch, "x86_64") == 0)) statement
in dirtylimit_start_vm() if the users run e.g. "make check-qtest-aarch64"
on their x86 host. Fix it by only executing the tests when we're running
with a x86_64 target QEMU binary with KVM.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/migration-test.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 71595a74fd..f83360e0e0 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -2439,6 +2439,7 @@ int main(int argc, char **argv)
 {
     char template[] = "/tmp/migration-test-XXXXXX";
     const bool has_kvm = qtest_has_accel("kvm");
+    const char *arch = qtest_get_arch();
     int ret;
 
     g_test_init(&argc, &argv, NULL);
@@ -2452,7 +2453,7 @@ int main(int argc, char **argv)
      * is touchy due to race conditions on dirty bits (especially on PPC for
      * some reason)
      */
-    if (g_str_equal(qtest_get_arch(), "ppc64") &&
+    if (g_str_equal(arch, "ppc64") &&
         (!has_kvm || access("/sys/module/kvm_hv", F_OK))) {
         g_test_message("Skipping test: kvm_hv not available");
         return g_test_run();
@@ -2462,7 +2463,7 @@ int main(int argc, char **argv)
      * Similar to ppc64, s390x seems to be touchy with TCG, so disable it
      * there until the problems are resolved
      */
-    if (g_str_equal(qtest_get_arch(), "s390x") && !has_kvm) {
+    if (g_str_equal(arch, "s390x") && !has_kvm) {
         g_test_message("Skipping test: s390x host with KVM is required");
         return g_test_run();
     }
@@ -2572,7 +2573,7 @@ int main(int argc, char **argv)
 #endif /* CONFIG_TASN1 */
 #endif /* CONFIG_GNUTLS */
 
-    if (kvm_dirty_ring_supported()) {
+    if (g_str_equal(arch, "x86_64") && has_kvm && kvm_dirty_ring_supported()) {
         qtest_add_func("/migration/dirty_ring",
                        test_precopy_unix_dirty_ring);
         qtest_add_func("/migration/vcpu_dirty_limit",
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tests/qtest/migration-test: Run the dirty ring tests only with the x86 target
  2022-08-01 11:46 [PATCH] tests/qtest/migration-test: Run the dirty ring tests only with the x86 target Thomas Huth
@ 2022-08-01 14:29 ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 2+ messages in thread
From: Dr. David Alan Gilbert @ 2022-08-01 14:29 UTC (permalink / raw)
  To: Thomas Huth
  Cc: Juan Quintela, qemu-devel, Laurent Vivier, Peter Maydell,
	Hyman Huang, peterx

* Thomas Huth (thuth@redhat.com) wrote:
> kvm_dirty_ring_supported() only checks whether the dirty ring support
> is available on the x86 host, but it ignores whether the target QEMU
> architecture is x86 or not. Thus the test_vcpu_dirty_limit() test
> currently fails with the assert((strcmp(arch, "x86_64") == 0)) statement
> in dirtylimit_start_vm() if the users run e.g. "make check-qtest-aarch64"
> on their x86 host. Fix it by only executing the tests when we're running
> with a x86_64 target QEMU binary with KVM.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>

I think that corresponds to a bug Juan mentioned where it was failing
with a i386 qemu as well.I guess there should be a more generic way!


Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  tests/qtest/migration-test.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
> index 71595a74fd..f83360e0e0 100644
> --- a/tests/qtest/migration-test.c
> +++ b/tests/qtest/migration-test.c
> @@ -2439,6 +2439,7 @@ int main(int argc, char **argv)
>  {
>      char template[] = "/tmp/migration-test-XXXXXX";
>      const bool has_kvm = qtest_has_accel("kvm");
> +    const char *arch = qtest_get_arch();
>      int ret;
>  
>      g_test_init(&argc, &argv, NULL);
> @@ -2452,7 +2453,7 @@ int main(int argc, char **argv)
>       * is touchy due to race conditions on dirty bits (especially on PPC for
>       * some reason)
>       */
> -    if (g_str_equal(qtest_get_arch(), "ppc64") &&
> +    if (g_str_equal(arch, "ppc64") &&
>          (!has_kvm || access("/sys/module/kvm_hv", F_OK))) {
>          g_test_message("Skipping test: kvm_hv not available");
>          return g_test_run();
> @@ -2462,7 +2463,7 @@ int main(int argc, char **argv)
>       * Similar to ppc64, s390x seems to be touchy with TCG, so disable it
>       * there until the problems are resolved
>       */
> -    if (g_str_equal(qtest_get_arch(), "s390x") && !has_kvm) {
> +    if (g_str_equal(arch, "s390x") && !has_kvm) {
>          g_test_message("Skipping test: s390x host with KVM is required");
>          return g_test_run();
>      }
> @@ -2572,7 +2573,7 @@ int main(int argc, char **argv)
>  #endif /* CONFIG_TASN1 */
>  #endif /* CONFIG_GNUTLS */
>  
> -    if (kvm_dirty_ring_supported()) {
> +    if (g_str_equal(arch, "x86_64") && has_kvm && kvm_dirty_ring_supported()) {
>          qtest_add_func("/migration/dirty_ring",
>                         test_precopy_unix_dirty_ring);
>          qtest_add_func("/migration/vcpu_dirty_limit",
> -- 
> 2.31.1
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-01 14:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-01 11:46 [PATCH] tests/qtest/migration-test: Run the dirty ring tests only with the x86 target Thomas Huth
2022-08-01 14:29 ` Dr. David Alan Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).