-/* $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>
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 &&
}
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) {
}
}
+ 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) \