Commit ede9c33e authored by Yunseong Kim's avatar Yunseong Kim Committed by Michael S. Tsirkin

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: default avatarYunseong Kim <yskelg@gmail.com>
Message-Id: <20240624174905.27980-2-yskelg@gmail.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 840b2d39
...@@ -139,7 +139,7 @@ static int parallel_test(u64 features, ...@@ -139,7 +139,7 @@ static int parallel_test(u64 features,
bool fast_vringh) bool fast_vringh)
{ {
void *host_map, *guest_map; 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 long xfers = 0, notifies = 0, receives = 0;
unsigned int first_cpu, last_cpu; unsigned int first_cpu, last_cpu;
cpu_set_t cpu_set; cpu_set_t cpu_set;
...@@ -161,8 +161,11 @@ static int parallel_test(u64 features, ...@@ -161,8 +161,11 @@ static int parallel_test(u64 features,
host_map = mmap(NULL, mapsize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); 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); guest_map = mmap(NULL, mapsize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
pipe(to_guest); pipe_ret = pipe(to_guest);
pipe(to_host); assert(!pipe_ret);
pipe_ret = pipe(to_host);
assert(!pipe_ret);
CPU_ZERO(&cpu_set); CPU_ZERO(&cpu_set);
find_cpus(&first_cpu, &last_cpu); find_cpus(&first_cpu, &last_cpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment