2 * collectd - src/ovs_events.c
4 * Copyright(c) 2016 Intel Corporation. All rights reserved.
6 * Permission is hereby granted, free of charge, to any person obtaining a copy of
7 * this software and associated documentation files (the "Software"), to deal in
8 * the Software without restriction, including without limitation the rights to
9 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10 * of the Software, and to permit persons to whom the Software is furnished to do
11 * so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * Volodymyr Mytnyk <volodymyrx.mytnyk@intel.com>
30 #include "common.h" /* auxiliary functions */
32 #include "utils_ovs.h" /* OVS helpers */
34 #define OVS_EVENTS_IFACE_NAME_SIZE 128
35 #define OVS_EVENTS_IFACE_UUID_SIZE 64
36 #define OVS_EVENTS_EXT_IFACE_ID_SIZE 64
37 #define OVS_EVENTS_EXT_VM_UUID_SIZE 64
38 #define OVS_EVENTS_PLUGIN "ovs_events"
39 #define OVS_EVENTS_CTX_LOCK \
40 for (int __i = ovs_events_ctx_lock(); __i != 0; __i = ovs_events_ctx_unlock())
41 #define OVS_EVENTS_CONFIG_ERROR(option) \
43 ERROR(OVS_EVENTS_PLUGIN ": read '%s' config option failed", option); \
47 /* Link status type */
48 enum ovs_events_link_status_e { DOWN, UP };
49 typedef enum ovs_events_link_status_e ovs_events_link_status_t;
52 struct ovs_events_iface_info_s {
53 char name[OVS_EVENTS_IFACE_NAME_SIZE]; /* interface name */
54 char uuid[OVS_EVENTS_IFACE_UUID_SIZE]; /* interface UUID */
55 char ext_iface_id[OVS_EVENTS_EXT_IFACE_ID_SIZE]; /* external interface id */
56 char ext_vm_uuid[OVS_EVENTS_EXT_VM_UUID_SIZE]; /* external VM UUID */
57 ovs_events_link_status_t link_status; /* interface link status */
58 struct ovs_events_iface_info_s *next; /* next interface info */
60 typedef struct ovs_events_iface_info_s ovs_events_iface_info_t;
63 struct ovs_events_iface_list_s {
64 char name[OVS_EVENTS_IFACE_NAME_SIZE]; /* interface name */
65 struct ovs_events_iface_list_s *next; /* next interface info */
67 typedef struct ovs_events_iface_list_s ovs_events_iface_list_t;
69 /* OVS events configuration data */
70 struct ovs_events_config_s {
71 _Bool send_notification; /* sent notification to collectd? */
72 char ovs_db_node[OVS_DB_ADDR_NODE_SIZE]; /* OVS DB node */
73 char ovs_db_serv[OVS_DB_ADDR_SERVICE_SIZE]; /* OVS DB service */
74 ovs_events_iface_list_t *ifaces; /* interface info */
76 typedef struct ovs_events_config_s ovs_events_config_t;
78 /* OVS events context type */
79 struct ovs_events_ctx_s {
80 pthread_mutex_t mutex; /* mutex to lock the context */
81 ovs_db_t *ovs_db; /* pointer to OVS DB instance */
82 ovs_events_config_t config; /* plugin config */
83 char *ovs_db_select_params; /* OVS DB select parameter request */
84 _Bool is_db_available; /* specify whether OVS DB is available */
86 typedef struct ovs_events_ctx_s ovs_events_ctx_t;
91 static ovs_events_ctx_t ovs_events_ctx = {
92 .mutex = PTHREAD_MUTEX_INITIALIZER,
93 .config = {.send_notification = 0, /* do not send notification */
94 .ovs_db_node = "localhost", /* use default OVS DB node */
95 .ovs_db_serv = "6640", /* use default OVS DB service */
97 .ovs_db_select_params = NULL,
101 /* This function is used only by "OVS_EVENTS_CTX_LOCK" define (see above).
102 * It always returns 1 when context is locked.
104 static int ovs_events_ctx_lock() {
105 pthread_mutex_lock(&ovs_events_ctx.mutex);
109 /* This function is used only by "OVS_EVENTS_CTX_LOCK" define (see above).
110 * It always returns 0 when context is unlocked.
112 static int ovs_events_ctx_unlock() {
113 pthread_mutex_unlock(&ovs_events_ctx.mutex);
117 /* Check if given interface name exists in configuration file. It
118 * returns 1 if exists otherwise 0. If no interfaces are configured,
121 static int ovs_events_config_iface_exists(const char *ifname) {
122 if (ovs_events_ctx.config.ifaces == NULL)
125 /* check if given interface exists */
126 for (ovs_events_iface_list_t *iface = ovs_events_ctx.config.ifaces; iface;
128 return (strcmp(ifname, iface->name) == 0);
133 /* Get OVS DB select parameter request based on rfc7047,
134 * "Transact" & "Select" section
136 static char *ovs_events_get_select_params() {
138 size_t buff_size = 0;
141 char *new_buff = NULL;
142 const char params_fmt[] = "[\"Open_vSwitch\"%s]";
143 const char option_fmt[] = ",{\"op\":\"select\",\"table\":\"Interface\","
144 "\"where\":[[\"name\",\"==\",\"%s\"]],"
145 "\"columns\":[\"link_state\",\"external_ids\","
146 "\"name\",\"_uuid\"]}";
147 const char default_opt[] = ",{\"op\":\"select\",\"table\":\"Interface\","
148 "\"where\":[],\"columns\":[\"link_state\","
149 "\"external_ids\",\"name\",\"_uuid\"]}";
150 /* setup OVS DB interface condition */
151 for (ovs_events_iface_list_t *iface = ovs_events_ctx.config.ifaces; iface;
152 iface = iface->next, offset += ret) {
153 /* allocate new buffer (format size + ifname len is good enough) */
154 buff_size += (sizeof(option_fmt) + strlen(iface->name));
155 new_buff = realloc(buff, buff_size);
156 if (new_buff == NULL)
159 ret = ssnprintf(buff + offset, buff_size, option_fmt, iface->name);
163 /* if no interfaces are configured, use default params */
165 buff = strdup(default_opt);
166 offset = strlen(default_opt);
169 /* allocate memory for OVS DB select params */
170 buff_size = offset + sizeof(params_fmt);
171 new_buff = malloc(buff_size);
172 if (new_buff == NULL)
175 /* create OVS DB select params */
176 if (ssnprintf(new_buff, buff_size, params_fmt, buff) < 0)
188 /* Release memory allocated for configuration data */
189 static void ovs_events_config_free() {
190 ovs_events_iface_list_t *del_iface = NULL;
191 sfree(ovs_events_ctx.ovs_db_select_params);
192 while (ovs_events_ctx.config.ifaces) {
193 del_iface = ovs_events_ctx.config.ifaces;
194 ovs_events_ctx.config.ifaces = ovs_events_ctx.config.ifaces->next;
199 /* Parse plugin configuration file and store the config
200 * in allocated memory. Returns negative value in case of error.
202 static int ovs_events_plugin_config(oconfig_item_t *ci) {
203 ovs_events_iface_list_t *new_iface;
205 for (int i = 0; i < ci->children_num; i++) {
206 oconfig_item_t *child = ci->children + i;
207 if (strcasecmp("SendNotification", child->key) == 0) {
208 if (cf_util_get_boolean(child, &ovs_events_ctx.config.send_notification) <
210 OVS_EVENTS_CONFIG_ERROR(child->key);
211 } else if (strcasecmp("OvsDbAddress", child->key) == 0) {
212 if (child->values_num < 1) {
213 ERROR(OVS_EVENTS_PLUGIN ": invalid OVS DB address specified");
216 /* check node type and get the value */
217 if (child->values[0].type != OCONFIG_TYPE_STRING) {
218 ERROR(OVS_EVENTS_PLUGIN ": OVS DB node is not a string");
221 sstrncpy(ovs_events_ctx.config.ovs_db_node, child->values[0].value.string,
222 sizeof(ovs_events_ctx.config.ovs_db_node));
223 /* get OVS DB address service name (optional) */
224 if (child->values_num > 1) {
225 if (child->values[1].type != OCONFIG_TYPE_STRING) {
226 ERROR(OVS_EVENTS_PLUGIN ": OVS DB service is not a string");
229 sstrncpy(ovs_events_ctx.config.ovs_db_serv,
230 child->values[1].value.string,
231 sizeof(ovs_events_ctx.config.ovs_db_serv));
233 } else if (strcasecmp("Interfaces", child->key) == 0) {
234 for (int j = 0; j < child->values_num; j++) {
235 /* check value type */
236 if (child->values[j].type != OCONFIG_TYPE_STRING) {
237 ERROR(OVS_EVENTS_PLUGIN
238 ": given interface name is not a string [idx=%d]",
242 /* allocate memory for configured interface */
243 if ((new_iface = malloc(sizeof(*new_iface))) == NULL) {
244 ERROR(OVS_EVENTS_PLUGIN ": malloc () copy interface name fail");
247 /* store interface name */
248 sstrncpy(new_iface->name, child->values[j].value.string,
249 sizeof(new_iface->name));
250 new_iface->next = ovs_events_ctx.config.ifaces;
251 ovs_events_ctx.config.ifaces = new_iface;
252 DEBUG(OVS_EVENTS_PLUGIN ": found monitored interface \"%s\"",
257 ERROR(OVS_EVENTS_PLUGIN ": option '%s' is not allowed here", child->key);
264 ovs_events_config_free();
268 /* Dispatch OVS interface link status event to collectd */
270 ovs_events_dispatch_notification(const ovs_events_iface_info_t *ifinfo) {
271 const char *msg_link_status = NULL;
273 NOTIF_FAILURE, cdtime(), "", "", OVS_EVENTS_PLUGIN, "", "", "", NULL};
275 /* convert link status to message string */
276 switch (ifinfo->link_status) {
278 msg_link_status = "UP";
279 n.severity = NOTIF_OKAY;
282 msg_link_status = "DOWN";
283 n.severity = NOTIF_WARNING;
286 ERROR(OVS_EVENTS_PLUGIN ": unknown interface link status");
290 /* add interface metadata to the notification */
291 if (plugin_notification_meta_add_string(&n, "uuid", ifinfo->uuid) < 0) {
292 ERROR(OVS_EVENTS_PLUGIN ": add interface uuid meta data failed");
296 if (strlen(ifinfo->ext_vm_uuid) > 0)
297 if (plugin_notification_meta_add_string(&n, "vm-uuid",
298 ifinfo->ext_vm_uuid) < 0) {
299 ERROR(OVS_EVENTS_PLUGIN ": add interface vm-uuid meta data failed");
303 if (strlen(ifinfo->ext_iface_id) > 0)
304 if (plugin_notification_meta_add_string(&n, "iface-id",
305 ifinfo->ext_iface_id) < 0) {
306 ERROR(OVS_EVENTS_PLUGIN ": add interface iface-id meta data failed");
310 /* fill the notification data */
311 ssnprintf(n.message, sizeof(n.message),
312 "link state of \"%s\" interface has been changed to \"%s\"",
313 ifinfo->name, msg_link_status);
314 sstrncpy(n.host, hostname_g, sizeof(n.host));
315 sstrncpy(n.plugin_instance, ifinfo->name, sizeof(n.plugin_instance));
316 sstrncpy(n.type, "gauge", sizeof(n.type));
317 sstrncpy(n.type_instance, "link_status", sizeof(n.type_instance));
318 plugin_dispatch_notification(&n);
321 /* Dispatch OVS interface link status value to collectd */
323 ovs_events_link_status_submit(const ovs_events_iface_info_t *ifinfo) {
324 value_list_t vl = VALUE_LIST_INIT;
325 meta_data_t *meta = NULL;
327 /* add interface metadata to the submit value */
328 if ((meta = meta_data_create()) != NULL) {
329 if (meta_data_add_string(meta, "uuid", ifinfo->uuid) < 0)
330 ERROR(OVS_EVENTS_PLUGIN ": add interface uuid meta data failed");
332 if (strlen(ifinfo->ext_vm_uuid) > 0)
333 if (meta_data_add_string(meta, "vm-uuid", ifinfo->ext_vm_uuid) < 0)
334 ERROR(OVS_EVENTS_PLUGIN ": add interface vm-uuid meta data failed");
336 if (strlen(ifinfo->ext_iface_id) > 0)
337 if (meta_data_add_string(meta, "iface-id", ifinfo->ext_iface_id) < 0)
338 ERROR(OVS_EVENTS_PLUGIN ": add interface iface-id meta data failed");
341 ERROR(OVS_EVENTS_PLUGIN ": create metadata failed");
344 vl.values = &(value_t){.gauge = (gauge_t)ifinfo->link_status};
346 sstrncpy(vl.plugin, OVS_EVENTS_PLUGIN, sizeof(vl.plugin));
347 sstrncpy(vl.plugin_instance, ifinfo->name, sizeof(vl.plugin_instance));
348 sstrncpy(vl.type, "gauge", sizeof(vl.type));
349 sstrncpy(vl.type_instance, "link_status", sizeof(vl.type_instance));
350 plugin_dispatch_values(&vl);
351 meta_data_destroy(meta);
354 /* Dispatch OVS DB terminate connection event to collectd */
355 static void ovs_events_dispatch_terminate_notification(const char *msg) {
357 NOTIF_FAILURE, cdtime(), "", "", OVS_EVENTS_PLUGIN, "", "", "", NULL};
358 sstrncpy(n.message, msg, sizeof(n.message));
359 sstrncpy(n.host, hostname_g, sizeof(n.host));
360 plugin_dispatch_notification(&n);
363 /* Get OVS DB interface information and stores it into
364 * ovs_events_iface_info_t structure */
365 static int ovs_events_get_iface_info(yajl_val jobject,
366 ovs_events_iface_info_t *ifinfo) {
367 yajl_val jexternal_ids = NULL;
368 yajl_val jvalue = NULL;
369 yajl_val juuid = NULL;
370 const char *state = NULL;
372 /* check YAJL type */
373 if (!YAJL_IS_OBJECT(jobject))
376 /* try to find external_ids, name and link_state fields */
377 jexternal_ids = ovs_utils_get_value_by_key(jobject, "external_ids");
378 if (jexternal_ids == NULL || ifinfo == NULL)
381 /* get iface-id from external_ids field */
382 jvalue = ovs_utils_get_map_value(jexternal_ids, "iface-id");
383 if (jvalue != NULL && YAJL_IS_STRING(jvalue))
384 sstrncpy(ifinfo->ext_iface_id, YAJL_GET_STRING(jvalue),
385 sizeof(ifinfo->ext_iface_id));
387 /* get vm-uuid from external_ids field */
388 jvalue = ovs_utils_get_map_value(jexternal_ids, "vm-uuid");
389 if (jvalue != NULL && YAJL_IS_STRING(jvalue))
390 sstrncpy(ifinfo->ext_vm_uuid, YAJL_GET_STRING(jvalue),
391 sizeof(ifinfo->ext_vm_uuid));
393 /* get interface uuid */
394 jvalue = ovs_utils_get_value_by_key(jobject, "_uuid");
395 if (jvalue == NULL || !YAJL_IS_ARRAY(jvalue) ||
396 YAJL_GET_ARRAY(jvalue)->len != 2)
398 juuid = YAJL_GET_ARRAY(jvalue)->values[1];
399 if (juuid == NULL || !YAJL_IS_STRING(juuid))
401 sstrncpy(ifinfo->uuid, YAJL_GET_STRING(juuid), sizeof(ifinfo->uuid));
403 /* get interface name */
404 jvalue = ovs_utils_get_value_by_key(jobject, "name");
405 if (jvalue == NULL || !YAJL_IS_STRING(jvalue))
407 sstrncpy(ifinfo->name, YAJL_GET_STRING(jvalue), sizeof(ifinfo->name));
409 /* get OVS DB interface link status */
410 jvalue = ovs_utils_get_value_by_key(jobject, "link_state");
411 if (jvalue != NULL && ((state = YAJL_GET_STRING(jvalue)) != NULL)) {
412 /* convert OVS table link state to link status */
413 if (strcmp(state, "up") == 0)
414 ifinfo->link_status = UP;
415 else if (strcmp(state, "down") == 0)
416 ifinfo->link_status = DOWN;
421 /* Process OVS DB update table event. It handles link status update event(s)
422 * and dispatches the value(s) to collectd if interface name matches one of
423 * interfaces specified in configuration file.
425 static void ovs_events_table_update_cb(yajl_val jupdates) {
426 yajl_val jnew_val = NULL;
427 yajl_val jupdate = NULL;
428 yajl_val jrow_update = NULL;
429 ovs_events_iface_info_t ifinfo;
431 /* JSON "Interface" table update example:
432 * ---------------------------------
435 * "9adf1db2-29ca-4140-ab22-ae347a4484de":
444 * "link_state":"down"
450 if (!YAJL_IS_OBJECT(jupdates) || !(YAJL_GET_OBJECT(jupdates)->len > 0)) {
451 ERROR(OVS_EVENTS_PLUGIN ": unexpected OVS DB update event received");
454 /* verify if this is a table event */
455 jupdate = YAJL_GET_OBJECT(jupdates)->values[0];
456 if (!YAJL_IS_OBJECT(jupdate)) {
457 ERROR(OVS_EVENTS_PLUGIN ": unexpected table update event received");
460 /* go through all row updates */
461 for (int row_index = 0; row_index < YAJL_GET_OBJECT(jupdate)->len;
463 jrow_update = YAJL_GET_OBJECT(jupdate)->values[row_index];
465 /* check row update */
466 jnew_val = ovs_utils_get_value_by_key(jrow_update, "new");
467 if (jnew_val == NULL) {
468 ERROR(OVS_EVENTS_PLUGIN ": unexpected row update received");
471 /* get OVS DB interface information */
472 if (ovs_events_get_iface_info(jnew_val, &ifinfo) < 0) {
473 ERROR(OVS_EVENTS_PLUGIN
474 " :unexpected interface information data received");
477 if (ovs_events_config_iface_exists(ifinfo.name) != 0)
478 /* dispatch notification */
479 ovs_events_dispatch_notification(&ifinfo);
483 /* OVD DB reply callback. It parses reply, receives
484 * interface information and dispatches the info to
487 static void ovs_events_poll_result_cb(yajl_val jresult, yajl_val jerror) {
488 yajl_val *jvalues = NULL;
489 yajl_val jvalue = NULL;
490 ovs_events_iface_info_t ifinfo;
492 if (!YAJL_IS_NULL(jerror)) {
493 ERROR(OVS_EVENTS_PLUGIN "error received by OVS DB server");
497 /* result should be an array */
498 if (!YAJL_IS_ARRAY(jresult)) {
499 ERROR(OVS_EVENTS_PLUGIN "invalid data (array is expected)");
503 /* go through all rows and get interface info */
504 jvalues = YAJL_GET_ARRAY(jresult)->values;
505 for (int i = 0; i < YAJL_GET_ARRAY(jresult)->len; i++) {
506 jvalue = ovs_utils_get_value_by_key(jvalues[i], "rows");
507 if (jvalue == NULL || !YAJL_IS_ARRAY(jvalue)) {
508 ERROR(OVS_EVENTS_PLUGIN "invalid data (array of rows is expected)");
511 /* get interfaces info */
512 for (int j = 0; j < YAJL_GET_ARRAY(jvalue)->len; j++) {
513 memset(&ifinfo, 0, sizeof(ifinfo));
514 if (ovs_events_get_iface_info(YAJL_GET_ARRAY(jvalue)->values[j],
516 ERROR(OVS_EVENTS_PLUGIN
517 "unexpected interface information data received");
520 DEBUG("name=%s, uuid=%s, ext_iface_id=%s, ext_vm_uuid=%s", ifinfo.name,
521 ifinfo.uuid, ifinfo.ext_iface_id, ifinfo.ext_vm_uuid);
522 ovs_events_link_status_submit(&ifinfo);
527 /* Setup OVS DB table callback. It subscribes to OVS DB 'Interface' table
528 * to receive link status event(s).
530 static void ovs_events_conn_initialize(ovs_db_t *pdb) {
532 const char tb_name[] = "Interface";
533 const char *columns[] = {"_uuid", "external_ids", "name", "link_state", NULL};
535 /* register update link status event if needed */
536 if (ovs_events_ctx.config.send_notification) {
537 ret = ovs_db_table_cb_register(pdb, tb_name, columns,
538 ovs_events_table_update_cb, NULL,
539 OVS_DB_TABLE_CB_FLAG_MODIFY);
541 ERROR(OVS_EVENTS_PLUGIN ": register OVS DB update callback failed");
545 OVS_EVENTS_CTX_LOCK { ovs_events_ctx.is_db_available = 1; }
546 DEBUG(OVS_EVENTS_PLUGIN ": OVS DB has been initialized");
549 /* OVS DB terminate connection notification callback */
550 static void ovs_events_conn_terminate() {
551 const char msg[] = "OVS DB connection has been lost";
552 if (ovs_events_ctx.config.send_notification)
553 ovs_events_dispatch_terminate_notification(msg);
554 WARNING(OVS_EVENTS_PLUGIN ": %s", msg);
555 OVS_EVENTS_CTX_LOCK { ovs_events_ctx.is_db_available = 0; }
558 /* Read OVS DB interface link status callback */
559 static int ovs_events_plugin_read(__attribute__((unused)) user_data_t *u) {
560 _Bool is_connected = 0;
561 OVS_EVENTS_CTX_LOCK { is_connected = ovs_events_ctx.is_db_available; }
563 if (ovs_db_send_request(ovs_events_ctx.ovs_db, "transact",
564 ovs_events_ctx.ovs_db_select_params,
565 ovs_events_poll_result_cb) < 0) {
566 ERROR(OVS_EVENTS_PLUGIN ": get interface info failed");
572 /* Initialize OVS plugin */
573 static int ovs_events_plugin_init(void) {
574 ovs_db_t *ovs_db = NULL;
575 ovs_db_callback_t cb = {.post_conn_init = ovs_events_conn_initialize,
576 .post_conn_terminate = ovs_events_conn_terminate};
578 DEBUG(OVS_EVENTS_PLUGIN ": OVS DB node = %s, service=%s",
579 ovs_events_ctx.config.ovs_db_node, ovs_events_ctx.config.ovs_db_serv);
581 /* generate OVS DB select condition based on list on configured interfaces */
582 ovs_events_ctx.ovs_db_select_params = ovs_events_get_select_params();
583 if (ovs_events_ctx.ovs_db_select_params == NULL) {
584 ERROR(OVS_EVENTS_PLUGIN ": fail to get OVS DB select condition");
585 goto ovs_events_failure;
588 /* initialize OVS DB */
589 ovs_db = ovs_db_init(ovs_events_ctx.config.ovs_db_node,
590 ovs_events_ctx.config.ovs_db_serv, &cb);
591 if (ovs_db == NULL) {
592 ERROR(OVS_EVENTS_PLUGIN ": fail to connect to OVS DB server");
593 goto ovs_events_failure;
596 /* store OVS DB handler */
597 OVS_EVENTS_CTX_LOCK { ovs_events_ctx.ovs_db = ovs_db; }
599 DEBUG(OVS_EVENTS_PLUGIN ": plugin has been initialized");
603 ERROR(OVS_EVENTS_PLUGIN ": plugin initialize failed");
604 /* release allocated memory */
605 ovs_events_config_free();
609 /* Shutdown OVS plugin */
610 static int ovs_events_plugin_shutdown(void) {
612 if (ovs_db_destroy(ovs_events_ctx.ovs_db))
613 ERROR(OVS_EVENTS_PLUGIN ": OVSDB object destroy failed");
615 /* release memory allocated for config */
616 ovs_events_config_free();
618 DEBUG(OVS_EVENTS_PLUGIN ": plugin has been destroyed");
622 /* Register OVS plugin callbacks */
623 void module_register(void) {
624 plugin_register_complex_config(OVS_EVENTS_PLUGIN, ovs_events_plugin_config);
625 plugin_register_init(OVS_EVENTS_PLUGIN, ovs_events_plugin_init);
626 plugin_register_complex_read(NULL, OVS_EVENTS_PLUGIN, ovs_events_plugin_read,
628 plugin_register_shutdown(OVS_EVENTS_PLUGIN, ovs_events_plugin_shutdown);