  {
  	int c, error, gdb_port, bvmcons, fw;
  	int dump_guest_memory, max_vcpus, mptgen;
-@@ -945,7 +953,7 @@ main(int argc, char *argv[])
+@@ -951,7 +959,7 @@ main(int argc, char *argv[])
  	/*
  	 * Head off to the main event dispatch loop
  	 */

 #include <xhyve/support/segments.h>
 
 #ifndef CTASSERT /* Allow lint to override */
@@ -43,6 +44,7 @@
 extern int guest_ncpus;
 extern char *guest_uuid_str;
 extern char *vmname;
+extern bool exit_mevent_dispatch_loop;
 
 void xh_vm_inject_fault(int vcpu, int vector, int errcode_valid,
     uint32_t errcode);
@@ -78,3 +80,5 @@ void vcpu_add(int fromcpu, int newcpu, uint64_t rip);
 int fbsdrun_vmexit_on_hlt(void);
 int fbsdrun_vmexit_on_pause(void);
 int fbsdrun_virtio_msix(void);

-void mevent_dispatch(void);
+int mevent_dispatch(void);
+void mevent_exit(void);
diff --git a/include/xhyve/uart_emul.h b/include/xhyve/uart_emul.h
index a4851a1..0cf1b3c 100644
--- a/include/xhyve/uart_emul.h
+++ b/include/xhyve/uart_emul.h
@@ -40,3 +40,5 @@ int uart_legacy_alloc(int unit, int *ioaddr, int *irq);
 uint8_t uart_read(struct uart_softc *sc, int offset);
 void uart_write(struct uart_softc *sc, int offset, uint8_t value);
 int uart_set_backend(struct uart_softc *sc, const char *backend, const char *devname);
+
+extern void go_set_pty_name(char *name);
diff --git a/include/xhyve/xhyve.h b/include/xhyve/xhyve.h
index 5464b2e..ac7f526 100644
--- a/include/xhyve/xhyve.h
+++ b/include/xhyve/xhyve.h
@@ -29,6 +29,7 @@
