Skip to content

Commit ede9c33

Browse files
kzall0cmstsirkin
authored andcommitted
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 <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 840b2d3 commit ede9c33

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tools/virtio/vringh_test.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static int parallel_test(u64 features,
139139
bool fast_vringh)
140140
{
141141
void *host_map, *guest_map;
142-
int fd, mapsize, to_guest[2], to_host[2];
142+
int pipe_ret, fd, mapsize, to_guest[2], to_host[2];
143143
unsigned long xfers = 0, notifies = 0, receives = 0;
144144
unsigned int first_cpu, last_cpu;
145145
cpu_set_t cpu_set;
@@ -161,8 +161,11 @@ static int parallel_test(u64 features,
161161
host_map = mmap(NULL, mapsize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
162162
guest_map = mmap(NULL, mapsize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
163163

164-
pipe(to_guest);
165-
pipe(to_host);
164+
pipe_ret = pipe(to_guest);
165+
assert(!pipe_ret);
166+
167+
pipe_ret = pipe(to_host);
168+
assert(!pipe_ret);
166169

167170
CPU_ZERO(&cpu_set);
168171
find_cpus(&first_cpu, &last_cpu);

0 commit comments

Comments
 (0)