| 678 | } |
| 679 | |
| 680 | int |
| 681 | rte_vhost_driver_enable_features(const char *path, uint64_t features) |
| 682 | { |
| 683 | struct vhost_user_socket *vsocket; |
| 684 | |
| 685 | pthread_mutex_lock(&vhost_user.mutex); |
| 686 | vsocket = find_vhost_user_socket(path); |
| 687 | if (vsocket) { |
| 688 | if ((vsocket->supported_features & features) != features) { |
| 689 | /* |
| 690 | * trying to enable features the driver doesn't |
| 691 | * support. |
| 692 | */ |
| 693 | pthread_mutex_unlock(&vhost_user.mutex); |
| 694 | return -1; |
| 695 | } |
| 696 | vsocket->features |= features; |
| 697 | } |
| 698 | pthread_mutex_unlock(&vhost_user.mutex); |
| 699 | |
| 700 | return vsocket ? 0 : -1; |
| 701 | } |
| 702 | |
| 703 | int |
| 704 | rte_vhost_driver_set_features(const char *path, uint64_t features) |
no test coverage detected