From patchwork Mon Jan 14 00:02:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 10761461 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 47B5B159A for ; Mon, 14 Jan 2019 00:09:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39CE6288D0 for ; Mon, 14 Jan 2019 00:09:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27CEB28A45; Mon, 14 Jan 2019 00:09:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C372F288D2 for ; Mon, 14 Jan 2019 00:09:40 +0000 (UTC) Received: from localhost ([127.0.0.1]:38786 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gipoy-0006np-0v for patchwork-qemu-devel@patchwork.kernel.org; Sun, 13 Jan 2019 19:09:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gipk2-0002uy-Fo for qemu-devel@nongnu.org; Sun, 13 Jan 2019 19:04:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gipk1-0006Jk-FB for qemu-devel@nongnu.org; Sun, 13 Jan 2019 19:04:34 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:60054) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gipjz-0006AK-I0 for qemu-devel@nongnu.org; Sun, 13 Jan 2019 19:04:32 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 958581B43; Mon, 14 Jan 2019 01:04:13 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q5Tk0upHgH1T; Mon, 14 Jan 2019 01:04:12 +0100 (CET) Received: from function.home (lfbn-1-11161-124.w86-213.abo.wanadoo.fr [86.213.235.124]) by hera.aquilenet.fr (Postfix) with ESMTPSA id F0BF71B8D; Mon, 14 Jan 2019 01:04:06 +0100 (CET) Received: from samy by function.home with local (Exim 4.92-RC4) (envelope-from ) id 1gipjY-0007nF-Ly; Mon, 14 Jan 2019 01:04:04 +0100 From: Samuel Thibault To: qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 01:02:24 +0100 Message-Id: <20190114000326.29847-4-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114000326.29847-1-samuel.thibault@ens-lyon.org> References: <20190114000326.29847-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 185.233.100.1 Subject: [Qemu-devel] [PULL 03/65] slirp: replace ex_pty with ex_chardev X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Samuel Thibault , stefanha@redhat.com, jan.kiszka@siemens.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Marc-André Lureau do_pty == 3 means to talk to a chardev. Signed-off-by: Marc-André Lureau Signed-off-by: Samuel Thibault --- 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 --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;