summaryrefslogtreecommitdiffstats
path: root/tools/virtio
diff options
context:
space:
mode:
authorYunseong Kim <yskelg@gmail.com>2024-06-24 19:49:06 +0200
committerMichael S. Tsirkin <mst@redhat.com>2024-07-04 17:00:31 +0200
commitede9c33ec568eed53f8f6bb42ed1d04af712cf02 (patch)
tree33f51e37e681166b3b46742596be3a6e410d6f2e /tools/virtio
parentvirtio_ring: fix KMSAN error for premapped mode (diff)
downloadlinux-ede9c33ec568eed53f8f6bb42ed1d04af712cf02.tar.xz
linux-ede9c33ec568eed53f8f6bb42ed1d04af712cf02.zip
tools/virtio: creating pipe assertion in vringh_test
parallel_test() function in vringh_test needs to verify the creation of the guest/host pipe. Signed-off-by: Yunseong Kim <yskelg@gmail.com> Message-Id: <20240624174905.27980-2-yskelg@gmail.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'tools/virtio')
-rw-r--r--tools/virtio/vringh_test.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/virtio/vringh_test.c b/tools/virtio/vringh_test.c
index 98ff808d6f0c..43d3a6aa1dcf 100644
--- a/tools/virtio/vringh_test.c
+++ b/tools/virtio/vringh_test.c
@@ -139,7 +139,7 @@ static int parallel_test(u64 features,
bool fast_vringh)
{
void *host_map, *guest_map;
- int fd, mapsize, to_guest[2], to_host[2];
+ int pipe_ret, fd, mapsize, to_guest[2], to_host[2];
unsigned long xfers = 0, notifies = 0, receives = 0;
unsigned int first_cpu, last_cpu;
cpu_set_t cpu_set;
@@ -161,8 +161,11 @@ static int parallel_test(u64 features,
host_map = mmap(NULL, mapsize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
guest_map = mmap(NULL, mapsize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
- pipe(to_guest);
- pipe(to_host);
+ pipe_ret = pipe(to_guest);
+ assert(!pipe_ret);
+
+ pipe_ret = pipe(to_host);
+ assert(!pipe_ret);
CPU_ZERO(&cpu_set);
find_cpus(&first_cpu, &last_cpu);