diff options
| -rw-r--r-- | sys/dev/vmt.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/dev/vmt.c b/sys/dev/vmt.c index 76346d31176..500552f70b2 100644 --- a/sys/dev/vmt.c +++ b/sys/dev/vmt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmt.c,v 1.21 2014/12/18 16:30:29 deraadt Exp $ */ +/* $OpenBSD: vmt.c,v 1.22 2014/12/18 19:18:22 reyk Exp $ */ /* * Copyright (c) 2007 David Crawshaw <david@zentus.com> @@ -492,6 +492,10 @@ vmt_tclo_tick(void *xarg) struct vmt_softc *sc = xarg; u_int32_t rlen; u_int16_t ack; + int delay; + + /* By default, poll every second for new messages */ + delay = 1; /* reopen tclo channel if it's currently closed */ if (sc->sc_tclo_rpc.channel == 0 && @@ -541,6 +545,9 @@ vmt_tclo_tick(void *xarg) } sc->sc_tclo_ping = 0; + /* The VM host can queue multiple messages; continue without delay */ + delay = 0; + if (strcmp(sc->sc_rpc_buf, "reset") == 0) { if (sc->sc_rpc_error != 0) { @@ -681,8 +688,13 @@ vmt_tclo_tick(void *xarg) } } + if (sc->sc_rpc_error == 1) { + /* On error, give time to recover and wait a second */ + delay = 1; + } + out: - timeout_add_sec(&sc->sc_tclo_tick, 1); + timeout_add_sec(&sc->sc_tclo_tick, delay); } #define BACKDOOR_OP_I386(op, frame) \ |
