X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fovsdb-idl.c;h=bca822464240307cdfe1250cce7c05417396e08f;hb=204bad294027fef6315b18b963d074139b3dfc52;hp=53be4ec0e7f3ad70a31983592ac181ef07b64221;hpb=bd76d25d8b3b7d11c5a326e91d784ad2cdeecd45;p=openvswitch diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index 53be4ec0..bca82246 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -342,7 +342,9 @@ ovsdb_idl_send_monitor_request(struct ovsdb_idl *idl) json_destroy(idl->monitor_request_id); msg = jsonrpc_create_request( - "monitor", json_array_create_2(json_null_create(), monitor_requests), + "monitor", + json_array_create_3(json_string_create(idl->class->database), + json_null_create(), monitor_requests), &idl->monitor_request_id); jsonrpc_session_send(idl->session, msg); } @@ -1072,7 +1074,8 @@ ovsdb_idl_txn_commit(struct ovsdb_idl_txn *txn) return txn->status; } - operations = json_array_create_empty(); + operations = json_array_create_1( + json_string_create(txn->idl->class->database)); /* Add prerequisites and declarations of new rows. */ HMAP_FOR_EACH (row, struct ovsdb_idl_row, txn_node, &txn->txn_rows) { @@ -1103,16 +1106,6 @@ ovsdb_idl_txn_commit(struct ovsdb_idl_txn *txn) &column->type)); } } - if (row->new && !row->old) { - struct json *op; - - op = json_object_create(); - json_array_add(operations, op); - json_object_put_string(op, "op", "declare"); - json_object_put(op, "uuid-name", - json_string_create_nocopy( - uuid_name_from_uuid(&row->uuid))); - } } /* Add updates. */ @@ -1148,7 +1141,7 @@ ovsdb_idl_txn_commit(struct ovsdb_idl_txn *txn) insert = xmalloc(sizeof *insert); insert->dummy = row->uuid; - insert->op_index = operations->u.array.n; + insert->op_index = operations->u.array.n - 1; uuid_zero(&insert->real); hmap_insert(&txn->inserted_rows, &insert->hmap_node, uuid_hash(&insert->dummy)); @@ -1184,7 +1177,7 @@ ovsdb_idl_txn_commit(struct ovsdb_idl_txn *txn) if (txn->inc_table && any_updates) { struct json *op; - txn->inc_index = operations->u.array.n; + txn->inc_index = operations->u.array.n - 1; op = json_object_create(); json_object_put_string(op, "op", "mutate");