diff mbox series

[ovs-dev,03/13] log: Make json parameter to ovsdb_log_write() const.

Message ID 20171208001240.25829-4-blp@ovn.org
State Accepted
Headers show
Series OVSDB log enhancements | expand

Commit Message

Ben Pfaff Dec. 8, 2017, 12:12 a.m. UTC
Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 ovsdb/log.c | 4 +++-
 ovsdb/log.h | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Justin Pettit Dec. 23, 2017, 4:13 a.m. UTC | #1
> On Dec 7, 2017, at 4:12 PM, Ben Pfaff <blp@ovn.org> wrote:
> 
> Signed-off-by: Ben Pfaff <blp@ovn.org>

Acked-by: Justin Pettit <jpettit@ovn.org>

--Justin
diff mbox series

Patch

diff --git a/ovsdb/log.c b/ovsdb/log.c
index d9fedd9ded6c..1a372d7b73ee 100644
--- a/ovsdb/log.c
+++ b/ovsdb/log.c
@@ -360,8 +360,10 @@  ovsdb_log_unread(struct ovsdb_log *file)
     file->offset = file->prev_offset;
 }
 
+/* Writes log record 'json' to 'file'.  Returns NULL if successful or an error
+ * (which the caller must eventually destroy) on failure. */
 struct ovsdb_error *
-ovsdb_log_write(struct ovsdb_log *file, struct json *json)
+ovsdb_log_write(struct ovsdb_log *file, const struct json *json)
 {
     uint8_t sha1[SHA1_DIGEST_SIZE];
     struct ovsdb_error *error;
diff --git a/ovsdb/log.h b/ovsdb/log.h
index fbcea1f2b991..fd495e518dd0 100644
--- a/ovsdb/log.h
+++ b/ovsdb/log.h
@@ -41,7 +41,7 @@  struct ovsdb_error *ovsdb_log_read(struct ovsdb_log *, struct json **)
     OVS_WARN_UNUSED_RESULT;
 void ovsdb_log_unread(struct ovsdb_log *);
 
-struct ovsdb_error *ovsdb_log_write(struct ovsdb_log *, struct json *)
+struct ovsdb_error *ovsdb_log_write(struct ovsdb_log *, const struct json *)
     OVS_WARN_UNUSED_RESULT;
 struct ovsdb_error *ovsdb_log_commit(struct ovsdb_log *)
     OVS_WARN_UNUSED_RESULT;