Skip to content

Commit

Permalink
rExport VLOG_WARN and VLOG_ERR from libovn for use in ddlog
Browse files Browse the repository at this point in the history
Export `ddlog_warn` and `ddlog_err` functions that are just wrappers
around `VLOG_WARN` and `VLOG_ERR`.  This is not ideal because the
functions are exported by `ovn_util.c` and the resulting log messages use
`ovn_util` as module name.  More importantly, these functions do not do
log rate limiting.

Signed-off-by: Leonid Ryzhyk <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Dumitru Ceara <[email protected]>
  • Loading branch information
ryzhyk authored and blp committed Feb 24, 2021
1 parent 110e670 commit e77cf75
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions TODO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ OVN To-do List
hashtable lookup in parse_port_group() which can be avoided when we are sure
that the Southbound DB uses the new format.

* ovn-northd-ddlog: Calls to warn() and err() from DDlog code would be
better refactored to use the Warning[] relation (and introduce an
Error[] relation once we want to issue some errors that way). This
would be easier with some improvements in DDlog to more easily
output to multiple relations from a single production.

* IP Multicast Relay

* When connecting bridged logical switches (localnet) to logical routers
Expand Down
15 changes: 15 additions & 0 deletions lib/ovn-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,3 +770,18 @@ ovn_get_internal_version(void)
sbrec_get_db_version(),
N_OVNACTS, OVN_INTERNAL_MINOR_VER);
}

#ifdef DDLOG
/* Callbacks used by the ddlog northd code to print warnings and errors. */
void
ddlog_warn(const char *msg)
{
VLOG_WARN("%s", msg);
}

void
ddlog_err(const char *msg)
{
VLOG_ERR("%s", msg);
}
#endif
5 changes: 5 additions & 0 deletions lib/ovn-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,4 +265,9 @@ BUILD_ASSERT_DECL(SCTP_INIT_CHUNK_LEN == sizeof(struct sctp_init_chunk));
/* The number of tables for the ingress and egress pipelines. */
#define LOG_PIPELINE_LEN 29

#ifdef DDLOG
void ddlog_warn(const char *msg);
void ddlog_err(const char *msg);
#endif

#endif

0 comments on commit e77cf75

Please sign in to comment.