Skip to content

Commit

Permalink
ovn-trace: need to read latest data when using daemon mode
Browse files Browse the repository at this point in the history
When logical flow changed in SB, the result that ovn-trace using daemon
mode evaluate is previous. Because the data from db just is read once
when ovn-trace startup. But the daemon mode is not adapted. So we need
to keep latest data from SB when ovn-trace use daemon mode.

Signed-off-by: Jun Gu <[email protected]>
  • Loading branch information
gujun4990 committed Dec 20, 2022
1 parent bae861d commit af360c5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions utilities/ovn-trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,15 @@ main(int argc, char *argv[])
}

if (ovsdb_idl_has_ever_connected(ovnsb_idl)) {
if (!already_read) {
already_read = true;
if (get_detach()) {
// When daemon mode, need to read latest data.
read_db();
} else {
// Non-daemon mode, just read once.
if (!already_read) {
already_read = true;
read_db();
}
}

daemonize_complete();
Expand Down

0 comments on commit af360c5

Please sign in to comment.