X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=utilities%2Fovs-vsctl.c;h=76e896a0a01797a77c3f5b6c73738bb6cff577d5;hb=fbb29a542d917040bd4d23900e8ef9bf5b1f6ea1;hp=0f86231338dedf4a8878024e3925720922a76255;hpb=e111e681e36810ac4c5a87c1428ac243ded0ab23;p=openvswitch diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c index 0f862313..76e896a0 100644 --- a/utilities/ovs-vsctl.c +++ b/utilities/ovs-vsctl.c @@ -41,9 +41,9 @@ #include "vswitchd/vswitch-idl.h" #include "timeval.h" #include "util.h" - #include "vlog.h" -#define THIS_MODULE VLM_vsctl + +VLOG_DEFINE_THIS_MODULE(vsctl) /* vsctl_fatal() also logs the error, so it is preferred in this file. */ #define ovs_fatal please_use_vsctl_fatal_instead_of_ovs_fatal @@ -118,6 +118,7 @@ static void set_column(const struct vsctl_table_class *, int main(int argc, char *argv[]) { + extern struct vlog_module VLM_reconnect; struct ovsdb_idl *idl; struct vsctl_command *commands; size_t n_commands; @@ -125,10 +126,8 @@ main(int argc, char *argv[]) set_program_name(argv[0]); signal(SIGPIPE, SIG_IGN); - time_init(); - vlog_init(); - vlog_set_levels(VLM_ANY_MODULE, VLF_CONSOLE, VLL_WARN); - vlog_set_levels(VLM_reconnect, VLF_ANY_FACILITY, VLL_WARN); + vlog_set_levels(NULL, VLF_CONSOLE, VLL_WARN); + vlog_set_levels(&VLM_reconnect, VLF_ANY_FACILITY, VLL_WARN); ovsrec_init(); /* Log our arguments. This is often valuable for debugging systems. */ @@ -203,7 +202,7 @@ parse_options(int argc, char *argv[]) break; case OPT_NO_SYSLOG: - vlog_set_levels(VLM_vsctl, VLF_SYSLOG, VLL_WARN); + vlog_set_levels(&VLM_vsctl, VLF_SYSLOG, VLL_WARN); break; case OPT_NO_WAIT: @@ -385,7 +384,7 @@ vsctl_fatal(const char *format, ...) message = xvasprintf(format, args); va_end(args); - vlog_set_levels(VLM_vsctl, VLF_CONSOLE, VLL_EMER); + vlog_set_levels(&VLM_vsctl, VLF_CONSOLE, VLL_EMER); VLOG_ERR("%s", message); ovs_error(0, "%s", message); vsctl_exit(EXIT_FAILURE); @@ -2654,7 +2653,7 @@ is_condition_satified(const struct vsctl_table_class *table, const char *operator; unsigned int idx; char *error; - int cmp; + int cmp = 0; error = parse_column_key_value(arg, table, &column, &key_string, &operator, operators, ARRAY_SIZE(operators), @@ -2787,7 +2786,7 @@ do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands, const char *unused; struct vsctl_command *c; int64_t next_cfg = 0; - char *error; + char *error = NULL; txn = the_idl_txn = ovsdb_idl_txn_create(idl); if (dry_run) {