mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
dpif-provider: Add class init function.
This init function is called when the dpif class is registered. It will be used by following commits Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Ethan Jackson <ethan@nicira.com>
This commit is contained in:
committed by
Ethan Jackson
parent
55e3ca97d1
commit
c8973eb634
@@ -135,6 +135,7 @@ static int
|
||||
dp_register_provider__(const struct dpif_class *new_class)
|
||||
{
|
||||
struct registered_dpif_class *registered_class;
|
||||
int error;
|
||||
|
||||
if (sset_contains(&dpif_blacklist, new_class->type)) {
|
||||
VLOG_DBG("attempted to register blacklisted provider: %s",
|
||||
@@ -148,6 +149,13 @@ dp_register_provider__(const struct dpif_class *new_class)
|
||||
return EEXIST;
|
||||
}
|
||||
|
||||
error = new_class->init ? new_class->init() : 0;
|
||||
if (error) {
|
||||
VLOG_WARN("failed to initialize %s datapath class: %s",
|
||||
new_class->type, ovs_strerror(error));
|
||||
return error;
|
||||
}
|
||||
|
||||
registered_class = xmalloc(sizeof *registered_class);
|
||||
registered_class->dpif_class = new_class;
|
||||
registered_class->refcount = 0;
|
||||
|
Reference in New Issue
Block a user