| 335 | } |
| 336 | |
| 337 | int |
| 338 | fdset_pipe_init(struct fdset *fdset) |
| 339 | { |
| 340 | int ret; |
| 341 | |
| 342 | if (pipe(fdset->u.pipefd) < 0) { |
| 343 | RTE_LOG(ERR, VHOST_FDMAN, |
| 344 | "failed to create pipe for vhost fdset\n"); |
| 345 | return -1; |
| 346 | } |
| 347 | |
| 348 | ret = fdset_add(fdset, fdset->u.readfd, |
| 349 | fdset_pipe_read_cb, NULL, fdset); |
| 350 | |
| 351 | if (ret < 0) { |
| 352 | RTE_LOG(ERR, VHOST_FDMAN, |
| 353 | "failed to add pipe readfd %d into vhost server fdset\n", |
| 354 | fdset->u.readfd); |
| 355 | |
| 356 | fdset_pipe_uninit(fdset); |
| 357 | return -1; |
| 358 | } |
| 359 | |
| 360 | return 0; |
| 361 | } |
| 362 | |
| 363 | void |
| 364 | fdset_pipe_notify(struct fdset *fdset) |
no test coverage detected