@@ -119,6 +119,13 @@ static void qemu_chr_open_stdio(Chardev *chr,
}
#endif
+void qemu_term_exit(void)
+{
+#ifndef _WIN32
+ term_exit();
+#endif
+}
+
static void qemu_chr_parse_stdio(QemuOpts *opts, ChardevBackend *backend,
Error **errp)
{
@@ -296,4 +296,6 @@ void save_char_socket_fd(Chardev *);
void load_char_socket_fd(Chardev *);
void save_char_pty_fd(Chardev *);
+void qemu_term_exit(void);
+
#endif
@@ -32,6 +32,7 @@
#include "migration.h"
#include "migration/snapshot.h"
#include "migration/vmstate.h"
+#include "chardev/char.h"
#include "migration/misc.h"
#include "migration/register.h"
#include "migration/global_state.h"
@@ -2772,6 +2773,7 @@ void save_cpr_snapshot(const char *file, const char *mode, Error **errp)
walkenv(FD_PREFIX, preserve_fd, 0);
reset_vhost_devices();
save_qmp_negotiation_status();
+ qemu_term_exit();
qemu_system_exec_request();
putenv((char *)"QEMU_START_FREEZE=");
}
If stdin is is a char backend device, then restore original stdin terminal settings in before re-exec'ing. Otherwise, the new qemu sees the modified settings as initial settings, and does not restore the true initial settings when it exits. Signed-off-by: Steve Sistare <steven.sistare@oracle.com> --- chardev/char-stdio.c | 7 +++++++ include/chardev/char.h | 2 ++ migration/savevm.c | 2 ++ 3 files changed, 11 insertions(+)