Acked-by: Alex Wang <al...@nicira.com>

Applied with following change to master, branch-2.3

diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index d6b9326..5c4d93b 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -1534,7 +1534,7 @@ ovsdb_idl_txn_commit(struct ovsdb_idl_txn *txn)
     bool any_updates;

     if (txn != txn->idl->txn) {
-        goto stats_out;
+        goto coverage_out;
     }

     /* If we need a lock but don't have it, give up quickly. */
@@ -1726,7 +1726,7 @@ ovsdb_idl_txn_commit(struct ovsdb_idl_txn *txn)

 disassemble_out:
     ovsdb_idl_txn_disassemble(txn);
-stats_out:
+coverage_out:
     switch (txn->status) {
     case TXN_UNCOMMITTED:   COVERAGE_INC(txn_uncommitted);    break;
     case TXN_UNCHANGED:     COVERAGE_INC(txn_unchanged);      break;



On Thu, May 29, 2014 at 5:25 PM, Ryan Wilson <wr...@nicira.com> wrote:

> Signed-off-by: Ryan Wilson <wr...@nicira.com>
> ---
>  lib/ovsdb-idl.c |   28 +++++++++++++++++++++++++---
>  1 file changed, 25 insertions(+), 3 deletions(-)
>
> diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
> index 7556b7f..d6b9326 100644
> --- a/lib/ovsdb-idl.c
> +++ b/lib/ovsdb-idl.c
> @@ -23,6 +23,7 @@
>  #include <stdlib.h>
>
>  #include "bitmap.h"
> +#include "coverage.h"
>  #include "dynamic-string.h"
>  #include "fatal-signal.h"
>  #include "json.h"
> @@ -37,6 +38,15 @@
>
>  VLOG_DEFINE_THIS_MODULE(ovsdb_idl);
>
> +COVERAGE_DEFINE(txn_uncommitted);
> +COVERAGE_DEFINE(txn_unchanged);
> +COVERAGE_DEFINE(txn_incomplete);
> +COVERAGE_DEFINE(txn_aborted);
> +COVERAGE_DEFINE(txn_success);
> +COVERAGE_DEFINE(txn_try_again);
> +COVERAGE_DEFINE(txn_not_locked);
> +COVERAGE_DEFINE(txn_error);
> +
>  /* An arc from one idl_row to another.  When row A contains a UUID that
>   * references row B, this is represented by an arc from A (the source) to
> B
>   * (the destination).
> @@ -1524,14 +1534,13 @@ ovsdb_idl_txn_commit(struct ovsdb_idl_txn *txn)
>      bool any_updates;
>
>      if (txn != txn->idl->txn) {
> -        return txn->status;
> +        goto stats_out;
>      }
>
>      /* If we need a lock but don't have it, give up quickly. */
>      if (txn->idl->lock_name && !ovsdb_idl_has_lock(txn->idl)) {
>          txn->status = TXN_NOT_LOCKED;
> -        ovsdb_idl_txn_disassemble(txn);
> -        return txn->status;
> +        goto disassemble_out;
>      }
>
>      operations = json_array_create_1(
> @@ -1715,7 +1724,20 @@ ovsdb_idl_txn_commit(struct ovsdb_idl_txn *txn)
>          txn->status = TXN_TRY_AGAIN;
>      }
>
> +disassemble_out:
>      ovsdb_idl_txn_disassemble(txn);
> +stats_out:
> +    switch (txn->status) {
> +    case TXN_UNCOMMITTED:   COVERAGE_INC(txn_uncommitted);    break;
> +    case TXN_UNCHANGED:     COVERAGE_INC(txn_unchanged);      break;
> +    case TXN_INCOMPLETE:    COVERAGE_INC(txn_incomplete);     break;
> +    case TXN_ABORTED:       COVERAGE_INC(txn_aborted);        break;
> +    case TXN_SUCCESS:       COVERAGE_INC(txn_success);        break;
> +    case TXN_TRY_AGAIN:     COVERAGE_INC(txn_try_again);      break;
> +    case TXN_NOT_LOCKED:    COVERAGE_INC(txn_not_locked);     break;
> +    case TXN_ERROR:         COVERAGE_INC(txn_error);          break;
> +    }
> +
>      return txn->status;
>  }
>
> --
> 1.7.9.5
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>



On Thu, May 29, 2014 at 5:25 PM, Ryan Wilson <wr...@nicira.com> wrote:

> Signed-off-by: Ryan Wilson <wr...@nicira.com>
> ---
>  lib/ovsdb-idl.c |   28 +++++++++++++++++++++++++---
>  1 file changed, 25 insertions(+), 3 deletions(-)
>
> diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
> index 7556b7f..d6b9326 100644
> --- a/lib/ovsdb-idl.c
> +++ b/lib/ovsdb-idl.c
> @@ -23,6 +23,7 @@
>  #include <stdlib.h>
>
>  #include "bitmap.h"
> +#include "coverage.h"
>  #include "dynamic-string.h"
>  #include "fatal-signal.h"
>  #include "json.h"
> @@ -37,6 +38,15 @@
>
>  VLOG_DEFINE_THIS_MODULE(ovsdb_idl);
>
> +COVERAGE_DEFINE(txn_uncommitted);
> +COVERAGE_DEFINE(txn_unchanged);
> +COVERAGE_DEFINE(txn_incomplete);
> +COVERAGE_DEFINE(txn_aborted);
> +COVERAGE_DEFINE(txn_success);
> +COVERAGE_DEFINE(txn_try_again);
> +COVERAGE_DEFINE(txn_not_locked);
> +COVERAGE_DEFINE(txn_error);
> +
>  /* An arc from one idl_row to another.  When row A contains a UUID that
>   * references row B, this is represented by an arc from A (the source) to
> B
>   * (the destination).
> @@ -1524,14 +1534,13 @@ ovsdb_idl_txn_commit(struct ovsdb_idl_txn *txn)
>      bool any_updates;
>
>      if (txn != txn->idl->txn) {
> -        return txn->status;
> +        goto stats_out;
>      }
>
>      /* If we need a lock but don't have it, give up quickly. */
>      if (txn->idl->lock_name && !ovsdb_idl_has_lock(txn->idl)) {
>          txn->status = TXN_NOT_LOCKED;
> -        ovsdb_idl_txn_disassemble(txn);
> -        return txn->status;
> +        goto disassemble_out;
>      }
>
>      operations = json_array_create_1(
> @@ -1715,7 +1724,20 @@ ovsdb_idl_txn_commit(struct ovsdb_idl_txn *txn)
>          txn->status = TXN_TRY_AGAIN;
>      }
>
> +disassemble_out:
>      ovsdb_idl_txn_disassemble(txn);
> +stats_out:
> +    switch (txn->status) {
> +    case TXN_UNCOMMITTED:   COVERAGE_INC(txn_uncommitted);    break;
> +    case TXN_UNCHANGED:     COVERAGE_INC(txn_unchanged);      break;
> +    case TXN_INCOMPLETE:    COVERAGE_INC(txn_incomplete);     break;
> +    case TXN_ABORTED:       COVERAGE_INC(txn_aborted);        break;
> +    case TXN_SUCCESS:       COVERAGE_INC(txn_success);        break;
> +    case TXN_TRY_AGAIN:     COVERAGE_INC(txn_try_again);      break;
> +    case TXN_NOT_LOCKED:    COVERAGE_INC(txn_not_locked);     break;
> +    case TXN_ERROR:         COVERAGE_INC(txn_error);          break;
> +    }
> +
>      return txn->status;
>  }
>
> --
> 1.7.9.5
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to