devargs->bus = &rte_vdev_bus;
if (args)
devargs->args = strdup(args);
+ else
+ devargs->args = strdup("");
ret = snprintf(devargs->name, sizeof(devargs->name), "%s", name);
if (ret < 0 || ret >= (int)sizeof(devargs->name)) {
return NULL;
}
+static int
+vdev_plug(struct rte_device *dev, const char *args __rte_unused)
+{
+ return vdev_probe_all_drivers(RTE_DEV_TO_VDEV(dev));
+}
+
static int
vdev_unplug(struct rte_device *dev)
{
- /*
- * The virtual bus doesn't support 'unattached' devices so this is
- * actually equal to hotplugging removal of it.
- */
return rte_vdev_uninit(dev->name);
}
.scan = vdev_scan,
.probe = vdev_probe,
.find_device = vdev_find_device,
- /* .plug = NULL, see comment on vdev_unplug */
+ .plug = vdev_plug,
.unplug = vdev_unplug,
.parse = vdev_parse,
};