]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: sefltests: Add explicit synchronization to move mem region test
authorSean Christopherson <sean.j.christopherson@intel.com>
Fri, 10 Apr 2020 23:17:02 +0000 (16:17 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 15 Apr 2020 16:08:43 +0000 (12:08 -0400)
commit22f08676740f94d38179147efdc3bbf624ca81ee
tree8f01c90f708c8b8de0f46ad6d10b84549847b1f4
parent6ca5bd72ef5634084837e7755b15ca15258757cb
KVM: sefltests: Add explicit synchronization to move mem region test

Use sem_post() and sem_timedwait() to synchronize test stages between
the vCPU thread and the main thread instead of using usleep() to wait
for the vCPU thread and hoping for the best.

Opportunistically refactor the code to make it suck less in general,
and to prepare for adding more testcases.

Suggested-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200410231707.7128-6-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/x86_64/set_memory_region_test.c