@@ -25,6 +25,7 @@
#include <unistd.h>
#include "openvswitch/json.h"
+#include "openvswitch/vlog.h"
#include "lockfile.h"
#include "ovsdb.h"
#include "ovsdb-error.h"
@@ -33,6 +34,8 @@
#include "transaction.h"
#include "util.h"
+VLOG_DEFINE_THIS_MODULE(ovsdb_log);
+
enum ovsdb_log_mode {
OVSDB_LOG_READ,
OVSDB_LOG_WRITE
@@ -411,6 +414,10 @@ ovsdb_log_write(struct ovsdb_log *file, const struct json *json)
{
error = ovsdb_io_error(errno, "%s: write failed", file->name);
+ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 5);
+ VLOG_WARN_RL(&rl, "%s: write failed (%s)",
+ file->name, ovs_strerror(errno));
+
/* Remove any partially written data, ignoring errors since there is
* nothing further we can do. */
ignore(ftruncate(fileno(file->stream), file->offset));
This saves all the callers from logging them separately. Signed-off-by: Ben Pfaff <blp@ovn.org> --- ovsdb/log.c | 7 +++++++ 1 file changed, 7 insertions(+)