| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Some OVSDB tools will want to open files that might be standalone or
clustered databases, and so it's better if ovsdb_log_open() can accept more
than one valid "magic". This commit makes that possible.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions will acquire users in future commits.
This new functionality made the internal state machine of the log hard
enough to understand that I thought that it was best to make it explicit
with a 'state' variable, so this commit introduces one.
This commit duplicates code and logic from ovsdb_rename() and
ovsdb_compact() in ovsdb/file.c. A future commit removes this duplication.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
|
|
|
|
|
|
|
|
| |
Until now, OVSDB_LOG_CREATE implied EXCL, but this commit breaks them
apart.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current and upcoming users of the OVSDB logging module only use
JSON objects as records. This commit simplifies the users slightly
by allowing them to always assume that the records are JSON objects.
Unfortunately this resulted in a large number of updates to tests,
which didn't always use JSON objects.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Until now, the logging code in ovsdb has only supported a single file
format, for OVSDB standalone database files. Upcoming commits will add
support for another, incompatible format, which uses a different magic
string for identification. This commit allows the logging code to
support both formats.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, error messages ended up looking like:
ovsdb-tool: I/O error: create: $DBFILE failed (File exists)
which is hard to understand. This commit changes them to:
ovsdb-tool: I/O error: $DBFILE: create failed (File exists)
which makes more sense.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
|
|
|
|
|
|
|
|
|
|
|
| |
When json_lex_input() returns false, the parser does not consume the byte
passed in. That byte will get processed again in the next iteration of
the json_parser_feed() loop. Therefore, until now, this code has
double-counted bytes that cause a false return from json_lex_input().
This fixes the problem. Every input byte is now counted only once.
Signed-off-by: Ben Pfaff <blp@nicira.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This code issues a warning if obtaining a lock takes even 1 millisecond.
That's far too aggressive. There's no need to warn if we have to wait
a few milliseconds. This function already warns elsewhere if locking takes
more than 1 second, which is much more reasonable.
This change allows us to test ovsdb-server stderr output more carefully.
Before now, the tests had to ignore what ovsdb-server writes to stderr
because sometimes it would log a warning that locking took 1 ms (or so).
Reviewed-by: Simon Horman <horms@verge.net.au>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current callers of ovsdb_log_open() always want to lock the file if
they are accessing it for read/write access. An upcoming commit will add
a new caller that does not fit this model (it wants to lock the file
across a wider region) and so the caller should be able to choose whether
to do locking. This commit adds that ability.
Also, get rid of the use of <fcntl.h> flags to choose the open mode, which
has always seemed somewhat crude and which this change would make even
cruder.
|
|
|
|
|
|
|
| |
The "lockfile" module logs a message if locking takes a measurable amount
of time. Running the tests under valgrind tends to make this message
appear, so we need to disable it to make the output comparison come out
cleanly.
|
| |
|
| |
|
|
This prepares for introducing a new, higher-level ovsdb_file that
encapsulates ovsdb storage in a file.
|