sigemptyset(&sighandler.sa_mask);
- /* Put STDIN into raw mode so that stuff typed does not echo to the screen
- * (the TTY reads will result in it being echoed back already), and also
- * ensure Ctrl-C, etc is blocked, and misc other bits */
- if (vshTTYMakeRaw(ctl, true) < 0)
- goto resettty;
-
if (!(con = virConsoleNew()))
goto resettty;
if (virDomainOpenConsole(dom, dev_name, con->st, flags) < 0)
goto cleanup;
+ vshPrintExtra(ctl, _("Connected to domain '%1$s'\n"), virDomainGetName(dom));
+ vshPrintExtra(ctl, _("Escape character is %1$s"), priv->escapeChar);
+ if (priv->escapeChar[0] == '^')
+ vshPrintExtra(ctl, " (Ctrl + %c)", priv->escapeChar[1]);
+ vshPrintExtra(ctl, "\n");
+ fflush(stdout);
+
+ /* Put STDIN into raw mode so that stuff typed does not echo to the screen
+ * (the TTY reads will result in it being echoed back already), and also
+ * ensure Ctrl-C, etc is blocked, and misc other bits */
+ if (vshTTYMakeRaw(ctl, true) < 0)
+ goto cleanup;
+
virObjectRef(con);
if ((con->stdinWatch = virEventAddHandle(STDIN_FILENO,
VIR_EVENT_HANDLE_READABLE,
unsigned int flags)
{
int state;
- virshControl *priv = ctl->privData;
if ((state = virshDomainState(ctl, dom, NULL)) < 0) {
vshError(ctl, "%s", _("Unable to get domain status"));
return false;
}
- vshPrintExtra(ctl, _("Connected to domain '%1$s'\n"), virDomainGetName(dom));
- vshPrintExtra(ctl, _("Escape character is %1$s"), priv->escapeChar);
- if (priv->escapeChar[0] == '^')
- vshPrintExtra(ctl, " (Ctrl + %c)", priv->escapeChar[1]);
- vshPrintExtra(ctl, "\n");
- fflush(stdout);
if (virshRunConsole(ctl, dom, name, resume_domain, flags) == 0)
return true;