vhost: introduce API to start a specific driver
[dpdk.git] / examples / tep_termination / main.c
index 18b977e..24c62cd 100644 (file)
@@ -1081,7 +1081,7 @@ new_device(int vid)
  * These callback allow devices to be added to the data core when configuration
  * has been fully complete.
  */
-static const struct virtio_net_device_ops virtio_net_device_ops = {
+static const struct vhost_device_ops virtio_net_device_ops = {
        .new_device =  new_device,
        .destroy_device = destroy_device,
 };
@@ -1263,7 +1263,13 @@ main(int argc, char *argv[])
                        "failed to register vhost driver callbacks.\n");
        }
 
-       rte_vhost_driver_session_start();
+       if (rte_vhost_driver_start(dev_basename) < 0) {
+               rte_exit(EXIT_FAILURE,
+                       "failed to start vhost driver.\n");
+       }
+
+       RTE_LCORE_FOREACH_SLAVE(lcore_id)
+               rte_eal_wait_lcore(lcore_id);
 
        return 0;
 }