-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathopenvswitch-ovsdb-idl-c.diff
691 lines (628 loc) · 18.4 KB
/
openvswitch-ovsdb-idl-c.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
--- openvswitch-2.3.0/lib/ovsdb-idl.c 2014-08-14 16:34:33.000000000 -0400
+++ openvswitch-2.3.0/lib/ovsdb-idl.c 2021-10-15 04:41:08.018202969 -0400
@@ -90,6 +90,12 @@
/* Transaction support. */
struct ovsdb_idl_txn *txn;
struct hmap outstanding_txns;
+
+#ifdef OPEN_CONTRAIL_CLIENT
+ void *open_contrail_client;
+ idl_callback cb;
+ txn_ack_callback ack_cb;
+#endif
};
struct ovsdb_idl_txn {
@@ -123,40 +129,40 @@
static struct vlog_rate_limit syntax_rl = VLOG_RATE_LIMIT_INIT(1, 5);
static struct vlog_rate_limit semantic_rl = VLOG_RATE_LIMIT_INIT(1, 5);
-static void ovsdb_idl_clear(struct ovsdb_idl *);
-static void ovsdb_idl_send_monitor_request(struct ovsdb_idl *);
-static void ovsdb_idl_parse_update(struct ovsdb_idl *, const struct json *);
-static struct ovsdb_error *ovsdb_idl_parse_update__(struct ovsdb_idl *,
+void ovsdb_idl_clear(struct ovsdb_idl *);
+void ovsdb_idl_send_monitor_request(struct ovsdb_idl *);
+void ovsdb_idl_parse_update(struct ovsdb_idl *, const struct json *);
+struct ovsdb_error *ovsdb_idl_parse_update__(struct ovsdb_idl *,
const struct json *);
-static bool ovsdb_idl_process_update(struct ovsdb_idl_table *,
+bool ovsdb_idl_process_update(struct ovsdb_idl_table *,
const struct uuid *,
const struct json *old,
const struct json *new);
-static void ovsdb_idl_insert_row(struct ovsdb_idl_row *, const struct json *);
-static void ovsdb_idl_delete_row(struct ovsdb_idl_row *);
-static bool ovsdb_idl_modify_row(struct ovsdb_idl_row *, const struct json *);
+void ovsdb_idl_insert_row(struct ovsdb_idl_row *, const struct json *);
+void ovsdb_idl_delete_row(struct ovsdb_idl_row *);
+bool ovsdb_idl_modify_row(struct ovsdb_idl_row *, const struct json *);
-static bool ovsdb_idl_row_is_orphan(const struct ovsdb_idl_row *);
-static struct ovsdb_idl_row *ovsdb_idl_row_create__(
+bool ovsdb_idl_row_is_orphan(const struct ovsdb_idl_row *);
+struct ovsdb_idl_row *ovsdb_idl_row_create__(
const struct ovsdb_idl_table_class *);
-static struct ovsdb_idl_row *ovsdb_idl_row_create(struct ovsdb_idl_table *,
+struct ovsdb_idl_row *ovsdb_idl_row_create(struct ovsdb_idl_table *,
const struct uuid *);
-static void ovsdb_idl_row_destroy(struct ovsdb_idl_row *);
+void ovsdb_idl_row_destroy(struct ovsdb_idl_row *);
-static void ovsdb_idl_row_parse(struct ovsdb_idl_row *);
-static void ovsdb_idl_row_unparse(struct ovsdb_idl_row *);
-static void ovsdb_idl_row_clear_old(struct ovsdb_idl_row *);
-static void ovsdb_idl_row_clear_new(struct ovsdb_idl_row *);
+void ovsdb_idl_row_parse(struct ovsdb_idl_row *);
+void ovsdb_idl_row_unparse(struct ovsdb_idl_row *);
+void ovsdb_idl_row_clear_old(struct ovsdb_idl_row *);
+void ovsdb_idl_row_clear_new(struct ovsdb_idl_row *);
-static void ovsdb_idl_txn_abort_all(struct ovsdb_idl *);
-static bool ovsdb_idl_txn_process_reply(struct ovsdb_idl *,
+void ovsdb_idl_txn_abort_all(struct ovsdb_idl *);
+bool ovsdb_idl_txn_process_reply(struct ovsdb_idl *,
const struct jsonrpc_msg *msg);
-static void ovsdb_idl_send_lock_request(struct ovsdb_idl *);
-static void ovsdb_idl_send_unlock_request(struct ovsdb_idl *);
-static void ovsdb_idl_parse_lock_reply(struct ovsdb_idl *,
+void ovsdb_idl_send_lock_request(struct ovsdb_idl *);
+void ovsdb_idl_send_unlock_request(struct ovsdb_idl *);
+void ovsdb_idl_parse_lock_reply(struct ovsdb_idl *,
const struct json *);
-static void ovsdb_idl_parse_lock_notify(struct ovsdb_idl *,
+void ovsdb_idl_parse_lock_notify(struct ovsdb_idl *,
const struct json *params,
bool new_has_lock);
@@ -192,7 +198,16 @@
idl = xzalloc(sizeof *idl);
idl->class = class;
+#ifdef OPEN_CONTRAIL_CLIENT
+ if (remote != NULL) {
+#endif
idl->session = jsonrpc_session_open(remote, retry);
+#ifdef OPEN_CONTRAIL_CLIENT
+ } else {
+ idl->session = NULL;
+ }
+ idl->cb = NULL;
+#endif
shash_init(&idl->table_by_name);
idl->tables = xmalloc(class->n_tables * sizeof *idl->tables);
for (i = 0; i < class->n_tables; i++) {
@@ -229,6 +244,9 @@
ovs_assert(!idl->txn);
ovsdb_idl_clear(idl);
+#ifdef OPEN_CONTRAIL_CLIENT
+ if (idl->session != NULL)
+#endif
jsonrpc_session_close(idl->session);
for (i = 0; i < idl->class->n_tables; i++) {
@@ -247,7 +265,7 @@
}
}
-static void
+void
ovsdb_idl_clear(struct ovsdb_idl *idl)
{
bool changed = false;
@@ -283,6 +301,27 @@
}
}
+#ifdef OPEN_CONTRAIL_CLIENT
+void
+ovsdb_idl_set_callback(struct ovsdb_idl *idl, void *idl_base, idl_callback i_cb,
+ txn_ack_callback ack_cb)
+{
+ idl->open_contrail_client = idl_base;
+ idl->cb = i_cb;
+ idl->ack_cb = ack_cb;
+}
+
+bool
+ovsdb_idl_is_txn_success(struct ovsdb_idl_txn *txn)
+{
+ return (txn->status == TXN_SUCCESS);
+}
+
+void ovsdb_idl_msg_process(struct ovsdb_idl *idl, struct jsonrpc_msg *msg);
+struct jsonrpc_msg *ovsdb_idl_encode_monitor_request(struct ovsdb_idl *idl);
+struct jsonrpc_msg *ovsdb_idl_txn_encode(struct ovsdb_idl_txn *txn);
+#endif
+
/* Processes a batch of messages from the database server on 'idl'. This may
* cause the IDL's contents to change. The client may check for that with
* ovsdb_idl_get_seqno(). */
@@ -313,6 +352,16 @@
break;
}
+#ifdef OPEN_CONTRAIL_CLIENT
+ ovsdb_idl_msg_process(idl, msg);
+ }
+}
+
+void
+ovsdb_idl_msg_process(struct ovsdb_idl *idl, struct jsonrpc_msg *msg)
+{
+#endif
+
if (msg->type == JSONRPC_NOTIFY
&& !strcmp(msg->method, "update")
&& msg->params->type == JSON_ARRAY
@@ -355,7 +404,9 @@
jsonrpc_msg_type_to_string(msg->type));
}
jsonrpc_msg_destroy(msg);
+#ifndef OPEN_CONTRAIL_CLIENT
}
+#endif
}
/* Arranges for poll_block() to wake up when ovsdb_idl_run() has something to
@@ -441,8 +492,8 @@
{
return jsonrpc_session_get_last_error(idl->session);
}
-
-static unsigned char *
+
+unsigned char *
ovsdb_idl_get_mode(struct ovsdb_idl *idl,
const struct ovsdb_idl_column *column)
{
@@ -462,7 +513,7 @@
OVS_NOT_REACHED();
}
-static void
+void
add_ref_table(struct ovsdb_idl *idl, const struct ovsdb_base_type *base)
{
if (base->type == OVSDB_TYPE_UUID && base->u.uuid.refTableName) {
@@ -549,10 +600,18 @@
{
*ovsdb_idl_get_mode(idl, column) = 0;
}
-
-static void
+
+void
ovsdb_idl_send_monitor_request(struct ovsdb_idl *idl)
{
+#ifdef OPEN_CONTRAIL_CLIENT
+ jsonrpc_session_send(idl->session, ovsdb_idl_encode_monitor_request(idl));
+}
+
+struct jsonrpc_msg *
+ovsdb_idl_encode_monitor_request(struct ovsdb_idl *idl)
+#endif
+{
struct json *monitor_requests;
struct jsonrpc_msg *msg;
size_t i;
@@ -588,10 +647,14 @@
json_array_create_3(json_string_create(idl->class->database),
json_null_create(), monitor_requests),
&idl->monitor_request_id);
+#ifndef OPEN_CONTRAIL_CLIENT
jsonrpc_session_send(idl->session, msg);
+#else
+ return msg;
+#endif
}
-static void
+void
ovsdb_idl_parse_update(struct ovsdb_idl *idl, const struct json *table_updates)
{
struct ovsdb_error *error = ovsdb_idl_parse_update__(idl, table_updates);
@@ -605,7 +668,7 @@
}
}
-static struct ovsdb_error *
+struct ovsdb_error *
ovsdb_idl_parse_update__(struct ovsdb_idl *idl,
const struct json *table_updates)
{
@@ -683,7 +746,7 @@
return NULL;
}
-static struct ovsdb_idl_row *
+struct ovsdb_idl_row *
ovsdb_idl_get_row(struct ovsdb_idl_table *table, const struct uuid *uuid)
{
struct ovsdb_idl_row *row;
@@ -698,7 +761,7 @@
/* Returns true if a column with mode OVSDB_IDL_MODE_RW changed, false
* otherwise. */
-static bool
+bool
ovsdb_idl_process_update(struct ovsdb_idl_table *table,
const struct uuid *uuid, const struct json *old,
const struct json *new)
@@ -752,7 +815,7 @@
/* Returns true if a column with mode OVSDB_IDL_MODE_RW changed, false
* otherwise. */
-static bool
+bool
ovsdb_idl_row_update(struct ovsdb_idl_row *row, const struct json *row_json)
{
struct ovsdb_idl_table *table = row->table;
@@ -809,7 +872,7 @@
*
* This function returns true if 'row' is an orphan row, otherwise false.
*/
-static bool
+bool
ovsdb_idl_row_is_orphan(const struct ovsdb_idl_row *row)
{
return !row->old && !row->new;
@@ -831,13 +894,13 @@
* This function will return false if 'row' is an orphan or if 'row' was
* deleted within the current transaction.
*/
-static bool
+bool
ovsdb_idl_row_exists(const struct ovsdb_idl_row *row)
{
return row->new != NULL;
}
-static void
+void
ovsdb_idl_row_parse(struct ovsdb_idl_row *row)
{
const struct ovsdb_idl_table_class *class = row->table->class;
@@ -849,7 +912,7 @@
}
}
-static void
+void
ovsdb_idl_row_unparse(struct ovsdb_idl_row *row)
{
const struct ovsdb_idl_table_class *class = row->table->class;
@@ -861,7 +924,7 @@
}
}
-static void
+void
ovsdb_idl_row_clear_old(struct ovsdb_idl_row *row)
{
ovs_assert(row->old == row->new);
@@ -877,7 +940,7 @@
}
}
-static void
+void
ovsdb_idl_row_clear_new(struct ovsdb_idl_row *row)
{
if (row->old != row->new) {
@@ -898,7 +961,7 @@
}
}
-static void
+void
ovsdb_idl_row_clear_arcs(struct ovsdb_idl_row *row, bool destroy_dsts)
{
struct ovsdb_idl_arc *arc, *next;
@@ -918,7 +981,7 @@
}
/* Force nodes that reference 'row' to reparse. */
-static void
+void
ovsdb_idl_row_reparse_backrefs(struct ovsdb_idl_row *row)
{
struct ovsdb_idl_arc *arc, *next;
@@ -939,10 +1002,14 @@
ovsdb_idl_row_unparse(ref);
ovsdb_idl_row_clear_arcs(ref, false);
ovsdb_idl_row_parse(ref);
+#ifdef OPEN_CONTRAIL_CLIENT
+ if (row->table->idl->cb)
+ row->table->idl->cb(ref->table->idl->open_contrail_client, 1, ref);
+#endif
}
}
-static struct ovsdb_idl_row *
+struct ovsdb_idl_row *
ovsdb_idl_row_create__(const struct ovsdb_idl_table_class *class)
{
struct ovsdb_idl_row *row = xzalloc(class->allocation_size);
@@ -953,7 +1020,7 @@
return row;
}
-static struct ovsdb_idl_row *
+struct ovsdb_idl_row *
ovsdb_idl_row_create(struct ovsdb_idl_table *table, const struct uuid *uuid)
{
struct ovsdb_idl_row *row = ovsdb_idl_row_create__(table->class);
@@ -963,7 +1030,7 @@
return row;
}
-static void
+void
ovsdb_idl_row_destroy(struct ovsdb_idl_row *row)
{
if (row) {
@@ -973,7 +1040,7 @@
}
}
-static void
+void
ovsdb_idl_insert_row(struct ovsdb_idl_row *row, const struct json *row_json)
{
const struct ovsdb_idl_table_class *class = row->table->class;
@@ -987,12 +1054,20 @@
ovsdb_idl_row_update(row, row_json);
ovsdb_idl_row_parse(row);
+#ifdef OPEN_CONTRAIL_CLIENT
+ if (row->table->idl->cb)
+ row->table->idl->cb(row->table->idl->open_contrail_client, 1, row);
+#endif
ovsdb_idl_row_reparse_backrefs(row);
}
-static void
+void
ovsdb_idl_delete_row(struct ovsdb_idl_row *row)
{
+#ifdef OPEN_CONTRAIL_CLIENT
+ if (row->table->idl->cb)
+ row->table->idl->cb(row->table->idl->open_contrail_client, 0, row);
+#endif
ovsdb_idl_row_unparse(row);
ovsdb_idl_row_clear_arcs(row, true);
ovsdb_idl_row_clear_old(row);
@@ -1005,7 +1080,7 @@
/* Returns true if a column with mode OVSDB_IDL_MODE_RW changed, false
* otherwise. */
-static bool
+bool
ovsdb_idl_modify_row(struct ovsdb_idl_row *row, const struct json *row_json)
{
bool changed;
@@ -1015,10 +1090,14 @@
changed = ovsdb_idl_row_update(row, row_json);
ovsdb_idl_row_parse(row);
+#ifdef OPEN_CONTRAIL_CLIENT
+ if (row->table->idl->cb)
+ row->table->idl->cb(row->table->idl->open_contrail_client, 1, row);
+#endif
return changed;
}
-static bool
+bool
may_add_arc(const struct ovsdb_idl_row *src, const struct ovsdb_idl_row *dst)
{
const struct ovsdb_idl_arc *arc;
@@ -1041,7 +1120,7 @@
return arc->src != src;
}
-static struct ovsdb_idl_table *
+struct ovsdb_idl_table *
ovsdb_idl_table_from_class(const struct ovsdb_idl *idl,
const struct ovsdb_idl_table_class *table_class)
{
@@ -1103,7 +1182,7 @@
return ovsdb_idl_get_row(ovsdb_idl_table_from_class(idl, tc), uuid);
}
-static struct ovsdb_idl_row *
+struct ovsdb_idl_row *
next_real_row(struct ovsdb_idl_table *table, struct hmap_node *node)
{
for (; node; node = hmap_next(&table->rows, node)) {
@@ -1207,7 +1286,7 @@
/* Transactions. */
-static void ovsdb_idl_txn_complete(struct ovsdb_idl_txn *txn,
+void ovsdb_idl_txn_complete(struct ovsdb_idl_txn *txn,
enum ovsdb_idl_txn_status);
/* Returns a string representation of 'status'. The caller must not modify or
@@ -1355,7 +1434,7 @@
}
}
-static struct json *
+struct json *
where_uuid_equals(const struct uuid *uuid)
{
return
@@ -1369,7 +1448,7 @@
xasprintf(UUID_FMT, UUID_ARGS(uuid))))));
}
-static char *
+char *
uuid_name_from_uuid(const struct uuid *uuid)
{
char *name;
@@ -1385,7 +1464,7 @@
return name;
}
-static const struct ovsdb_idl_row *
+const struct ovsdb_idl_row *
ovsdb_idl_txn_get_row(const struct ovsdb_idl_txn *txn, const struct uuid *uuid)
{
const struct ovsdb_idl_row *row;
@@ -1399,7 +1478,7 @@
}
/* XXX there must be a cleaner way to do this */
-static struct json *
+struct json *
substitute_uuids(struct json *json, const struct ovsdb_idl_txn *txn)
{
if (json->type == JSON_ARRAY) {
@@ -1437,7 +1516,7 @@
return json;
}
-static void
+void
ovsdb_idl_txn_disassemble(struct ovsdb_idl_txn *txn)
{
struct ovsdb_idl_row *row, *next;
@@ -1529,6 +1608,21 @@
enum ovsdb_idl_txn_status
ovsdb_idl_txn_commit(struct ovsdb_idl_txn *txn)
{
+#ifdef OPEN_CONTRAIL_CLIENT
+ struct jsonrpc_msg *msg = ovsdb_idl_txn_encode(txn);
+ if (msg != NULL) {
+ if (jsonrpc_session_send(txn->idl->session, msg)) {
+ txn->status = TXN_TRY_AGAIN;
+ }
+ }
+ return txn->status;
+}
+
+struct jsonrpc_msg *
+ovsdb_idl_txn_encode(struct ovsdb_idl_txn *txn)
+{
+ struct jsonrpc_msg *msg = NULL;
+#endif
struct ovsdb_idl_row *row;
struct json *operations;
bool any_updates;
@@ -1713,6 +1807,7 @@
if (!any_updates) {
txn->status = TXN_UNCHANGED;
json_destroy(operations);
+#ifndef OPEN_CONTRAIL_CLIENT
} else if (!jsonrpc_session_send(
txn->idl->session,
jsonrpc_create_request(
@@ -1722,6 +1817,14 @@
txn->status = TXN_INCOMPLETE;
} else {
txn->status = TXN_TRY_AGAIN;
+#else
+ msg = NULL;
+ } else {
+ msg = jsonrpc_create_request("transact", operations, &txn->request_id);
+ hmap_insert(&txn->idl->outstanding_txns, &txn->hmap_node,
+ json_hash(txn->request_id, 0));
+ txn->status = TXN_INCOMPLETE;
+#endif
}
disassemble_out:
@@ -1738,7 +1841,11 @@
case TXN_ERROR: COVERAGE_INC(txn_error); break;
}
+#ifndef OPEN_CONTRAIL_CLIENT
return txn->status;
+#else
+ return msg;
+#endif
}
/* Attempts to commit 'txn', blocking until the commit either succeeds or
@@ -1807,7 +1914,7 @@
}
}
-static void
+void
ovsdb_idl_txn_set_error_json(struct ovsdb_idl_txn *txn,
const struct json *json)
{
@@ -1841,12 +1948,16 @@
return NULL;
}
-static void
+void
ovsdb_idl_txn_complete(struct ovsdb_idl_txn *txn,
enum ovsdb_idl_txn_status status)
{
txn->status = status;
hmap_remove(&txn->idl->outstanding_txns, &txn->hmap_node);
+#ifdef OPEN_CONTRAIL_CLIENT
+ if (txn->idl->ack_cb)
+ txn->idl->ack_cb(txn->idl->open_contrail_client, txn);
+#endif
}
/* Writes 'datum' to the specified 'column' in 'row_'. Updates both 'row_'
@@ -1866,7 +1977,7 @@
* Takes ownership of what 'datum' points to (and in some cases destroys that
* data before returning) but makes a copy of 'datum' itself. (Commonly
* 'datum' is on the caller's stack.) */
-static void
+void
ovsdb_idl_txn_write__(const struct ovsdb_idl_row *row_,
const struct ovsdb_idl_column *column,
struct ovsdb_datum *datum, bool owns_datum)
@@ -2086,7 +2197,7 @@
return row;
}
-static void
+void
ovsdb_idl_txn_abort_all(struct ovsdb_idl *idl)
{
struct ovsdb_idl_txn *txn;
@@ -2096,7 +2207,7 @@
}
}
-static struct ovsdb_idl_txn *
+struct ovsdb_idl_txn *
ovsdb_idl_txn_find(struct ovsdb_idl *idl, const struct json *id)
{
struct ovsdb_idl_txn *txn;
@@ -2110,7 +2221,7 @@
return NULL;
}
-static bool
+bool
check_json_type(const struct json *json, enum json_type type, const char *name)
{
if (!json) {
@@ -2126,7 +2237,7 @@
}
}
-static bool
+bool
ovsdb_idl_txn_process_inc_reply(struct ovsdb_idl_txn *txn,
const struct json_array *results)
{
@@ -2178,7 +2289,7 @@
return true;
}
-static bool
+bool
ovsdb_idl_txn_process_insert_reply(struct ovsdb_idl_txn_insert *insert,
const struct json_array *results)
{
@@ -2218,7 +2329,7 @@
return true;
}
-static bool
+bool
ovsdb_idl_txn_process_reply(struct ovsdb_idl *idl,
const struct jsonrpc_msg *msg)
{
@@ -2366,7 +2477,7 @@
return idl->is_lock_contended;
}
-static void
+void
ovsdb_idl_update_has_lock(struct ovsdb_idl *idl, bool new_has_lock)
{
if (new_has_lock && !idl->has_lock) {
@@ -2382,7 +2493,7 @@
idl->has_lock = new_has_lock;
}
-static void
+void
ovsdb_idl_send_lock_request__(struct ovsdb_idl *idl, const char *method,
struct json **idp)
{
@@ -2400,19 +2511,19 @@
}
}
-static void
+void
ovsdb_idl_send_lock_request(struct ovsdb_idl *idl)
{
ovsdb_idl_send_lock_request__(idl, "lock", &idl->lock_request_id);
}
-static void
+void
ovsdb_idl_send_unlock_request(struct ovsdb_idl *idl)
{
ovsdb_idl_send_lock_request__(idl, "unlock", NULL);
}
-static void
+void
ovsdb_idl_parse_lock_reply(struct ovsdb_idl *idl, const struct json *result)
{
bool got_lock;
@@ -2435,7 +2546,7 @@
}
}
-static void
+void
ovsdb_idl_parse_lock_notify(struct ovsdb_idl *idl,
const struct json *params,
bool new_has_lock)