From patchwork Mon Jan 14 22:52:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 10763501 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 2AE6513BF for ; Mon, 14 Jan 2019 23:01:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C75F2AC7C for ; Mon, 14 Jan 2019 23:01:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AC942C489; Mon, 14 Jan 2019 23:01:04 +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 B17652ACF7 for ; Mon, 14 Jan 2019 23:01:03 +0000 (UTC) Received: from localhost ([127.0.0.1]:59985 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjBE7-0002bq-1X for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 18:01:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjB6k-0004Be-Up for qemu-devel@nongnu.org; Mon, 14 Jan 2019 17:53:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjB6h-0001CJ-NB for qemu-devel@nongnu.org; Mon, 14 Jan 2019 17:53:25 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:40286) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gjB6h-0001A7-9z for qemu-devel@nongnu.org; Mon, 14 Jan 2019 17:53:23 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id C4ADF1BBB; Mon, 14 Jan 2019 23:53:17 +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 XsBMO9YRGYLd; Mon, 14 Jan 2019 23:53:16 +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 AB1C81BB2; Mon, 14 Jan 2019 23:53:09 +0100 (CET) Received: from samy by function.home with local (Exim 4.92-RC4) (envelope-from ) id 1gjB6S-0005dj-E6; Mon, 14 Jan 2019 23:53:08 +0100 From: Samuel Thibault To: qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 23:52:04 +0100 Message-Id: <20190114225306.21569-4-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114225306.21569-1-samuel.thibault@ens-lyon.org> References: <20190114225306.21569-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;