Skip to content

Commit 3031e02

Browse files
xzpeterbonzini
authored andcommitted
KVM: selftests: Always clear dirty bitmap after iteration
We used not to clear the dirty bitmap before because KVM_GET_DIRTY_LOG would overwrite it the next time it copies the dirty log onto it. In the upcoming dirty ring tests we'll start to fetch dirty pages from a ring buffer, so no one is going to clear the dirty bitmap for us. Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20201001012228.5916-1-peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 31d2129 commit 3031e02

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/testing/selftests/kvm/dirty_log_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ static void vm_dirty_log_verify(enum vm_guest_mode mode, unsigned long *bmap)
195195
page);
196196
}
197197

198-
if (test_bit_le(page, bmap)) {
198+
if (test_and_clear_bit_le(page, bmap)) {
199199
host_dirty_count++;
200200
/*
201201
* If the bit is set, the value written onto

0 commit comments

Comments
 (0)