Skip to content

Commit 63e7151

Browse files
author
Claudio Imbrenda
committed
KVM: s390: selftests: fix ucontrol memory region test
With the latest patch, attempting to create a memslot from userspace will result in an EEXIST error for UCONTROL VMs, instead of EINVAL, since the new memslot will collide with the internal memslot. There is no simple way to bring back the previous behaviour. This is not a problem, but the test needs to be fixed accordingly. Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com> Link: https://lore.kernel.org/r/20250123144627.312456-5-imbrenda@linux.ibm.com Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Message-ID: <20250123144627.312456-5-imbrenda@linux.ibm.com>
1 parent 413c98f commit 63e7151

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/testing/selftests/kvm/s390/ucontrol_test.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,14 @@ TEST_F(uc_kvm, uc_no_user_region)
459459
};
460460

461461
ASSERT_EQ(-1, ioctl(self->vm_fd, KVM_SET_USER_MEMORY_REGION, &region));
462-
ASSERT_EQ(EINVAL, errno);
462+
ASSERT_TRUE(errno == EEXIST || errno == EINVAL)
463+
TH_LOG("errno %s (%i) not expected for ioctl KVM_SET_USER_MEMORY_REGION",
464+
strerror(errno), errno);
463465

464466
ASSERT_EQ(-1, ioctl(self->vm_fd, KVM_SET_USER_MEMORY_REGION2, &region2));
465-
ASSERT_EQ(EINVAL, errno);
467+
ASSERT_TRUE(errno == EEXIST || errno == EINVAL)
468+
TH_LOG("errno %s (%i) not expected for ioctl KVM_SET_USER_MEMORY_REGION2",
469+
strerror(errno), errno);
466470
}
467471

468472
TEST_F(uc_kvm, uc_map_unmap)

0 commit comments

Comments
 (0)