Skip to content

Commit

Permalink
ovsdb-idl: Remove 'uuid' member of struct ovsdb_idl.
Browse files Browse the repository at this point in the history
This was used to uniquely identify the monitor, but there's no need for
that.  A fixed monitor name works fine.

Signed-off-by: Ben Pfaff <[email protected]>
Acked-by: Alin Gabriel Serdean <[email protected]>
  • Loading branch information
blp committed Dec 11, 2017
1 parent fca1b42 commit 7a36082
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions lib/ovsdb-idl.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ struct ovsdb_idl {
unsigned int state_seqno; /* See above. */
struct json *request_id; /* JSON ID for request awaiting reply. */
struct json *schema; /* Temporary copy of database schema. */
struct uuid uuid; /* Identifier for monitor. */

/* Database locking. */
char *lock_name; /* Name of lock we need, NULL if none. */
Expand Down Expand Up @@ -344,7 +343,6 @@ ovsdb_idl_create(const char *remote, const struct ovsdb_idl_class *class,
idl->schema = NULL;

hmap_init(&idl->outstanding_txns);
uuid_generate(&idl->uuid);

return idl;
}
Expand Down Expand Up @@ -1211,8 +1209,7 @@ static void
ovsdb_idl_send_cond_change(struct ovsdb_idl *idl)
{
int i;
char uuid[UUID_LEN + 1];
struct json *params, *json_uuid;
struct json *params;
struct jsonrpc_msg *request;

/* When 'idl-request_id' is not NULL, there is an outstanding
Expand Down Expand Up @@ -1244,15 +1241,8 @@ ovsdb_idl_send_cond_change(struct ovsdb_idl *idl)

/* Send request if not empty. */
if (monitor_cond_change_requests) {
snprintf(uuid, sizeof uuid, UUID_FMT,
UUID_ARGS(&idl->uuid));
json_uuid = json_string_create(uuid);

/* Create a new uuid */
uuid_generate(&idl->uuid);
snprintf(uuid, sizeof uuid, UUID_FMT,
UUID_ARGS(&idl->uuid));
params = json_array_create_3(json_uuid, json_string_create(uuid),
params = json_array_create_3(json_string_create("monid"),
json_string_create("monid"),
monitor_cond_change_requests);

request = jsonrpc_create_request("monitor_cond_change", params,
Expand Down Expand Up @@ -1553,7 +1543,6 @@ ovsdb_idl_send_monitor_request__(struct ovsdb_idl *idl,
struct shash *schema;
struct json *monitor_requests;
struct jsonrpc_msg *msg;
char uuid[UUID_LEN + 1];
size_t i;

schema = parse_schema(idl->schema);
Expand Down Expand Up @@ -1612,11 +1601,10 @@ ovsdb_idl_send_monitor_request__(struct ovsdb_idl *idl,

json_destroy(idl->request_id);

snprintf(uuid, sizeof uuid, UUID_FMT, UUID_ARGS(&idl->uuid));
msg = jsonrpc_create_request(
method,
json_array_create_3(json_string_create(idl->class_->database),
json_string_create(uuid), monitor_requests),
json_string_create("monid"), monitor_requests),
&idl->request_id);
jsonrpc_session_send(idl->session, msg);
idl->cond_changed = false;
Expand Down

0 comments on commit 7a36082

Please sign in to comment.