ofp-util: Add macros for composing error codes.
[openvswitch] / utilities / ovs-vsctl.c
index 1585faee5e1f4b401043060f77ab3168957c5e01..4f346f14fa6a44552746022d5912a7ce42fa0d7c 100644 (file)
@@ -43,7 +43,7 @@
 #include "util.h"
 #include "vlog.h"
 
-VLOG_DEFINE_THIS_MODULE(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
@@ -1073,6 +1073,7 @@ cmd_add_br(struct vsctl_context *ctx)
 
         iface = ovsrec_interface_insert(ctx->txn);
         ovsrec_interface_set_name(iface, br_name);
+        ovsrec_interface_set_type(iface, "internal");
 
         port = ovsrec_port_insert(ctx->txn);
         ovsrec_port_set_name(port, br_name);
@@ -2838,7 +2839,7 @@ do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands,
     }
     error = xstrdup(ovsdb_idl_txn_get_error(txn));
     ovsdb_idl_txn_destroy(txn);
-    the_idl_txn = NULL;
+    txn = the_idl_txn = NULL;
 
     unused = ovsdb_symbol_table_find_unused(symtab);
     if (unused) {
@@ -2927,8 +2928,10 @@ do_vsctl(const char *args, struct vsctl_command *commands, size_t n_commands,
 try_again:
     /* Our transaction needs to be rerun, or a prerequisite was not met.  Free
      * resources and return so that the caller can try again. */
-    ovsdb_idl_txn_abort(txn);
-    ovsdb_idl_txn_destroy(txn);
+    if (txn) {
+        ovsdb_idl_txn_abort(txn);
+        ovsdb_idl_txn_destroy(txn);
+    }
     ovsdb_symbol_table_destroy(symtab);
     for (c = commands; c < &commands[n_commands]; c++) {
         ds_destroy(&c->output);