lib/ovsdb-idl.c
/* Called by ovsdb-idlc generated code. */
Called by ovsdb-idlc generated code.
Called by ovsdb - idlc generated code .
struct ovsdb_idl_row *
ovsdb_idl_get_row_arc(struct ovsdb_idl_row *src,
                      const struct ovsdb_idl_table_class *dst_table_class,
                      const struct uuid *dst_uuid)
{
    struct ovsdb_idl_db *db = src->table->db;
    struct ovsdb_idl_table *dst_table;
    struct ovsdb_idl_arc *arc;
    struct ovsdb_idl_row *dst;
    dst_table = ovsdb_idl_db_table_from_class(db, dst_table_class);
    dst = ovsdb_idl_get_row(dst_table, dst_uuid);
    if (db->txn || is_index_row(src)) {
        if (dst && (hmap_node_is_null(&dst->txn_node) || dst->new_datum)) {
            return dst;
        }
        return NULL;
    } else {
        if (!dst) {
            dst = ovsdb_idl_row_create(dst_table, dst_uuid);
        }
        if (may_add_arc(src, dst)) {
            arc = xmalloc(sizeof *arc);
            ovs_list_push_front(&src->src_arcs, &arc->src_node);
            ovs_list_push_front(&dst->dst_arcs, &arc->dst_node);
            arc->src = src;
            arc->dst = dst;
        }
        return !ovsdb_idl_row_is_orphan(dst) ? dst : NULL;
    }
}
struct ovsdb_idl_row * ovsdb_idl_get_row_arc ( struct ovsdb_idl_row * src , const struct ovsdb_idl_table_class * dst_table_class , const struct uuid * dst_uuid ) { struct ovsdb_idl_db * db = src -> table -> db ; struct ovsdb_idl_table * dst_table ; struct ovsdb_idl_arc * arc ; struct ovsdb_idl_row * dst ; dst_table = ovsdb_idl_db_table_from_class ( db , dst_table_class ) ; dst = ovsdb_idl_get_row ( dst_table , dst_uuid ) ; if ( db -> txn || is_index_row ( src ) ) { if ( dst && ( hmap_node_is_null ( & dst -> txn_node ) || dst -> new_datum ) ) { return dst ; } return NULL ; } else { if ( ! dst ) { dst = ovsdb_idl_row_create ( dst_table , dst_uuid ) ; } if ( may_add_arc ( src , dst ) ) { arc = xmalloc ( sizeof * arc ) ; ovs_list_push_front ( & src -> src_arcs , & arc -> src_node ) ; ovs_list_push_front ( & dst -> dst_arcs , & arc -> dst_node ) ; arc -> src = src ; arc -> dst = dst ; } return ! ovsdb_idl_row_is_orphan ( dst ) ? dst : NULL ; } }
Called by ovsdb-idlc generated code.
Called by ovsdb - idlc generated code .
/* There are two cases we should not update any arcs:
         *
         * 1. We're being called from ovsdb_idl_txn_write(). We must not update
         * any arcs, because the transaction will be backed out at commit or
         * abort time and we don't want our graph screwed up.
         *
         * 2. The row is used as an index for querying purpose only.
         *
         * In these cases, just return the destination row, if there is one and
         * it has not been deleted. */ /* We're being called from some other context.  Update the graph. */ /* Add a new arc, if it wouldn't be a self-arc or a duplicate arc. */ /* The arc *must* be added at the front of the dst_arcs list.  See
             * ovsdb_idl_row_reparse_backrefs() for details. */