diff mbox series

[PULL,03/65] slirp: replace ex_pty with ex_chardev

Message ID 20190114225306.21569-4-samuel.thibault@ens-lyon.org (mailing list archive)
State New, archived
Headers show
Series [PULL,01/65] slirp: associate slirp_output callback with the Slirp context | expand

Commit Message

Samuel Thibault Jan. 14, 2019, 10:52 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

do_pty == 3 means to talk to a chardev.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 slirp/misc.c     | 2 +-
 slirp/misc.h     | 2 +-
 slirp/slirp.c    | 4 ++--
 slirp/tcp_subr.c | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/slirp/misc.c b/slirp/misc.c
index e69d5f42c3..8f0b6004bd 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -53,7 +53,7 @@  int add_exec(struct ex_list **ex_ptr, int do_pty, char *exec,
 	*ex_ptr = g_new(struct ex_list, 1);
 	(*ex_ptr)->ex_fport = port;
 	(*ex_ptr)->ex_addr = addr;
-	(*ex_ptr)->ex_pty = do_pty;
+	(*ex_ptr)->ex_chardev = do_pty == 3;
 	(*ex_ptr)->ex_exec = (do_pty == 3) ? exec : g_strdup(exec);
 	(*ex_ptr)->ex_next = tmp_ptr;
 	return 0;
diff --git a/slirp/misc.h b/slirp/misc.h
index 897650aea1..1f8d11def6 100644
--- a/slirp/misc.h
+++ b/slirp/misc.h
@@ -9,7 +9,7 @@ 
 #define MISC_H
 
 struct ex_list {
-	int ex_pty;			/* Do we want a pty? */
+	int ex_chardev;
 	struct in_addr ex_addr;		/* Server address */
 	int ex_fport;                   /* Port to telnet to */
 	const char *ex_exec;            /* Command line of what to exec */
diff --git a/slirp/slirp.c b/slirp/slirp.c
index 4d4c2c13b5..0498a092b9 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.c
@@ -1455,7 +1455,7 @@  static void slirp_state_save(QEMUFile *f, void *opaque)
     struct ex_list *ex_ptr;
 
     for (ex_ptr = slirp->exec_list; ex_ptr; ex_ptr = ex_ptr->ex_next)
-        if (ex_ptr->ex_pty == 3) {
+        if (ex_ptr->ex_chardev) {
             struct socket *so;
             so = slirp_find_ctl_socket(slirp, ex_ptr->ex_addr,
                                        ntohs(ex_ptr->ex_fport));
@@ -1490,7 +1490,7 @@  static int slirp_state_load(QEMUFile *f, void *opaque, int version_id)
             return -EINVAL;
         }
         for (ex_ptr = slirp->exec_list; ex_ptr; ex_ptr = ex_ptr->ex_next) {
-            if (ex_ptr->ex_pty == 3 &&
+            if (ex_ptr->ex_chardev &&
                 so->so_faddr.s_addr == ex_ptr->ex_addr.s_addr &&
                 so->so_fport == ex_ptr->ex_fport) {
                 break;
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
index 0ccd8e1a96..dc19eea55a 100644
--- a/slirp/tcp_subr.c
+++ b/slirp/tcp_subr.c
@@ -960,7 +960,7 @@  int tcp_ctl(struct socket *so)
         for (ex_ptr = slirp->exec_list; ex_ptr; ex_ptr = ex_ptr->ex_next) {
             if (ex_ptr->ex_fport == so->so_fport &&
                 so->so_faddr.s_addr == ex_ptr->ex_addr.s_addr) {
-                if (ex_ptr->ex_pty == 3) {
+                if (ex_ptr->ex_chardev) {
                     so->s = -1;
                     so->extra = (void *)ex_ptr->ex_exec;
                     return 1;