summaryrefslogtreecommitdiff
path: root/ovsdb/ovsdb-tool.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2017-12-24 11:43:59 -0800
committerBen Pfaff <blp@ovn.org>2017-12-24 11:43:59 -0800
commit19b276cb4423b0cd723821eea0e91061080c76e5 (patch)
tree1aab323854667c7f55f0e6a910684cd225fa18d0 /ovsdb/ovsdb-tool.c
parent09de8591d28ef596e1c62cf0b6a2d6e6a8988e1e (diff)
downloadopenvswitch-19b276cb4423b0cd723821eea0e91061080c76e5.tar.gz
log: Allow client to specify magic.
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>
Diffstat (limited to 'ovsdb/ovsdb-tool.c')
-rw-r--r--ovsdb/ovsdb-tool.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ovsdb/ovsdb-tool.c b/ovsdb/ovsdb-tool.c
index 2c5931aa1..157ebabc7 100644
--- a/ovsdb/ovsdb-tool.c
+++ b/ovsdb/ovsdb-tool.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
+ * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2016, 2017 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -219,8 +219,8 @@ do_create(struct ovs_cmdl_context *ctx)
ovsdb_schema_destroy(schema);
/* Create database file. */
- check_ovsdb_error(ovsdb_log_open(db_file_name, OVSDB_LOG_CREATE,
- -1, &log));
+ check_ovsdb_error(ovsdb_log_open(db_file_name, OVSDB_MAGIC,
+ OVSDB_LOG_CREATE, -1, &log));
check_ovsdb_error(ovsdb_log_write(log, json));
check_ovsdb_error(ovsdb_log_commit(log));
ovsdb_log_close(log);
@@ -544,8 +544,8 @@ do_show_log(struct ovs_cmdl_context *ctx)
struct ovsdb_schema *schema;
unsigned int i;
- check_ovsdb_error(ovsdb_log_open(db_file_name, OVSDB_LOG_READ_ONLY,
- -1, &log));
+ check_ovsdb_error(ovsdb_log_open(db_file_name, OVSDB_MAGIC,
+ OVSDB_LOG_READ_ONLY, -1, &log));
shash_init(&names);
schema = NULL;
for (i = 0; ; i++) {