2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-17 14:28:02 +00:00

vconn: Convert vconn code to modern OVS structure.

The vconn code is a relative fossil as OVS code goes.  It was written
before we had really figured how code should fit together.  Part of that
history is that it used poll_fd_callback() to register callbacks without
the assistance of other code.  That isn't how the rest of OVS works now;
this code is the only remaining user of that function.

To make it more like the rest of the system, this code gets rid of the use
of poll_fd_callback().  It also adds vconn_run() and vconn_run_wait()
functions and calls to them from the places where they are now required.
This commit is contained in:
Ben Pfaff
2010-01-06 14:27:46 -08:00
parent 539e96f623
commit 60cb3eb8b2
9 changed files with 141 additions and 64 deletions

View File

@@ -459,6 +459,15 @@ void
rconn_run(struct rconn *rc)
{
int old_state;
size_t i;
if (rc->vconn) {
vconn_run(rc->vconn);
}
for (i = 0; i < rc->n_monitors; i++) {
vconn_run(rc->monitors[i]);
}
do {
old_state = rc->state;
switch (rc->state) {
@@ -476,7 +485,17 @@ rconn_run(struct rconn *rc)
void
rconn_run_wait(struct rconn *rc)
{
unsigned int timeo = timeout(rc);
unsigned int timeo;
size_t i;
if (rc->vconn) {
vconn_run_wait(rc->vconn);
}
for (i = 0; i < rc->n_monitors; i++) {
vconn_run_wait(rc->monitors[i]);
}
timeo = timeout(rc);
if (timeo != UINT_MAX) {
unsigned int expires = sat_add(rc->state_entered, timeo);
unsigned int remaining = sat_sub(expires, time_now());