[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH V1 28/32] char: restore terminal on restart
From: |
Steve Sistare |
Subject: |
[PATCH V1 28/32] char: restore terminal on restart |
Date: |
Thu, 30 Jul 2020 08:14:32 -0700 |
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(+)
diff --git a/chardev/char-stdio.c b/chardev/char-stdio.c
index 82eaebc..6481d08 100644
--- a/chardev/char-stdio.c
+++ b/chardev/char-stdio.c
@@ -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)
{
diff --git a/include/chardev/char.h b/include/chardev/char.h
index c18bda8..5fd3ecc 100644
--- a/include/chardev/char.h
+++ b/include/chardev/char.h
@@ -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
diff --git a/migration/savevm.c b/migration/savevm.c
index 732dfb5..881dc13 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -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=");
}
--
1.8.3.1
- Re: [PATCH V1 12/32] vl: pause option, (continued)
[PATCH V1 14/32] savevm: VMS_RESTART and cprsave restart, Steve Sistare, 2020/07/30
[PATCH V1 15/32] vl: QEMU_START_FREEZE env var, Steve Sistare, 2020/07/30
[PATCH V1 16/32] oslib: add qemu_clr_cloexec, Steve Sistare, 2020/07/30
[PATCH V1 17/32] util: env var helpers, Steve Sistare, 2020/07/30
[PATCH V1 20/32] vl: add helper to request re-exec, Steve Sistare, 2020/07/30
[PATCH V1 22/32] char: qio_channel_socket_accept reuse fd, Steve Sistare, 2020/07/30
[PATCH V1 28/32] char: restore terminal on restart,
Steve Sistare <=
[PATCH V1 29/32] pci: export pci_update_mappings, Steve Sistare, 2020/07/30
[PATCH V1 25/32] char: save/restore chardev pty fds, Steve Sistare, 2020/07/30
[PATCH V1 24/32] ui: save/restore vnc socket fds, Steve Sistare, 2020/07/30
[PATCH V1 31/32] vfio-pci: trace pci config, Steve Sistare, 2020/07/30
[PATCH V1 02/32] savevm: VM handlers mode mask, Steve Sistare, 2020/07/30
[PATCH V1 05/32] savevm: QMP command for cprload, Steve Sistare, 2020/07/30