diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c index bb739bdb8c..43d4973c24 100644 --- a/tools/console/daemon/io.c +++ b/tools/console/daemon/io.c @@ -781,6 +781,10 @@ static int console_create_ring(struct console *con) con->log_fd = create_console_log(con); out: + /* Mark the console connected. */ + if (!err && con->interface) + con->interface->connection = XENCONSOLE_CONNECTED; + return err; } diff --git a/xen/include/public/io/console.h b/xen/include/public/io/console.h index 4509b4b689..b9ebfaff3f 100644 --- a/xen/include/public/io/console.h +++ b/xen/include/public/io/console.h @@ -19,6 +19,19 @@ struct xencons_interface { char out[2048]; XENCONS_RING_IDX in_cons, in_prod; XENCONS_RING_IDX out_cons, out_prod; +/* + * Flag values signaling from backend to frontend whether the console is + * connected. i.e. Whether it will be serviced and emptied. + * + * The flag starts as disconnected. + */ +#define XENCONSOLE_DISCONNECTED 1 +/* + * The flag is set to connected when the backend connects and the console + * will be serviced. + */ +#define XENCONSOLE_CONNECTED 0 + uint8_t connection; }; #ifdef XEN_WANT_FLEX_CONSOLE_RING