From f756401ddda1349e024dbf631d5774efb9e7f55a Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Tue, 20 Mar 2018 16:30:51 -0700 Subject: [PATCH] VOM: Fix connection state Change-Id: I4851b2245f81bcf3cf5f40909c4d158a51af7068 Signed-off-by: Neale Ranns --- src/vpp-api/vom/hw.cpp | 12 +++++------- src/vpp-api/vom/om.cpp | 4 ++++ src/vpp-api/vom/rpc_cmd.hpp | 6 +++++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/vpp-api/vom/hw.cpp b/src/vpp-api/vom/hw.cpp index 8f64a75c092..0952b60f9d9 100644 --- a/src/vpp-api/vom/hw.cpp +++ b/src/vpp-api/vom/hw.cpp @@ -74,16 +74,14 @@ HW::cmd_q::enqueue(std::queue& cmds) bool HW::cmd_q::connect() { - int rv; - if (m_connected) return m_connected; - rv = m_conn.connect(); - - m_connected = true; - m_rx_thread.reset(new std::thread(&HW::cmd_q::rx_run, this)); - return (rv == 0); + if (0 == m_conn.connect()) { + m_connected = true; + m_rx_thread.reset(new std::thread(&HW::cmd_q::rx_run, this)); + } + return (m_connected); } void diff --git a/src/vpp-api/vom/om.cpp b/src/vpp-api/vom/om.cpp index 5ac7e9da44b..edfc046e740 100644 --- a/src/vpp-api/vom/om.cpp +++ b/src/vpp-api/vom/om.cpp @@ -15,6 +15,7 @@ #include +#include "vom/logger.hpp" #include "vom/om.hpp" namespace VOM { @@ -82,6 +83,7 @@ OM::remove(const client_db::key_t& key) void OM::replay() { + VOM_LOG(log_level_t::INFO) << "replay"; /* * the listeners are sorted in dependency order */ @@ -106,6 +108,8 @@ OM::dump(std::ostream& os) void OM::populate(const client_db::key_t& key) { + VOM_LOG(log_level_t::INFO) << "populate"; + /* * the listeners are sorted in dependency order */ diff --git a/src/vpp-api/vom/rpc_cmd.hpp b/src/vpp-api/vom/rpc_cmd.hpp index bd78978a3cf..84b6717c53b 100644 --- a/src/vpp-api/vom/rpc_cmd.hpp +++ b/src/vpp-api/vom/rpc_cmd.hpp @@ -105,7 +105,11 @@ public: * Called by the HW Command Q when it is disabled to indicate the * command can be considered successful without issuing it to HW */ - virtual void succeeded() { m_hw_item.set(rc_t::OK); } + virtual void succeeded() + { + m_hw_item.set(rc_t::OK); + VOM_LOG(log_level_t::DEBUG) << to_string(); + } /** * call operator used as a callback by VAPI when the reply is available -- 2.16.6