@@ -316,7 +316,10 @@ int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
flexarray_append(ro_front, "output");
flexarray_append(ro_front, console->output);
flexarray_append(ro_front, "tty");
- flexarray_append(ro_front, "");
+ if (state && state->console_tty)
+ flexarray_append(ro_front, state->console_tty);
+ else
+ flexarray_append(ro_front, "");
if (state) {
flexarray_append(ro_front, "port");
@@ -1697,6 +1697,7 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
libxl__domain_build_state *state;
libxl__domain_save_state *dss;
char *dom_path, *xs_store_mfn, *xs_console_mfn;
+ const char *console_tty;
uint32_t domid_out;
int rc;
@@ -1737,6 +1738,15 @@ static int do_domain_soft_reset(libxl_ctx *ctx,
state->console_mfn = xs_console_mfn ? atol(xs_console_mfn): 0;
free(xs_console_mfn);
+ rc = libxl__xs_read_mandatory(gc, XBT_NULL,
+ GCSPRINTF("%s/console/tty", dom_path),
+ &console_tty);
+ if (rc) {
+ LOGD(ERROR, domid_soft_reset, "failed to read console/tty.");
+ goto out;
+ }
+ state->console_tty = libxl__strdup(gc, console_tty);
+
dss->ao = ao;
dss->domid = dss->dsps.domid = domid_soft_reset;
dss->dsps.dm_savefile = GCSPRINTF(LIBXL_DEVICE_MODEL_SAVE_FILE".%d",
@@ -1123,6 +1123,7 @@ typedef struct {
uint32_t console_port;
uint32_t console_domid;
unsigned long console_mfn;
+ char *console_tty;
char *saved_state;