Skip to content

Commit

Permalink
tools/virtio: creating pipe assertion in vringh_test
Browse files Browse the repository at this point in the history
parallel_test() function in vringh_test needs to verify
the creation of the guest/host pipe.

Signed-off-by: Yunseong Kim <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
  • Loading branch information
yskelg authored and mstsirkin committed Jul 4, 2024
1 parent 840b2d3 commit ede9c33
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/virtio/vringh_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit ede9c33

Please sign in to comment.