From patchwork Mon Oct 19 14:28:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Nesterov X-Patchwork-Id: 7437521 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A03289F37F for ; Mon, 19 Oct 2015 14:32:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CABF4205E2 for ; Mon, 19 Oct 2015 14:32:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D8029205DC for ; Mon, 19 Oct 2015 14:32:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753551AbbJSOcY (ORCPT ); Mon, 19 Oct 2015 10:32:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11767 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752519AbbJSOcY (ORCPT ); Mon, 19 Oct 2015 10:32:24 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 19479C0B7877; Mon, 19 Oct 2015 14:32:24 +0000 (UTC) Received: from tranklukator.brq.redhat.com (dhcp-1-102.brq.redhat.com [10.34.1.102]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t9JEWMwQ026272; Mon, 19 Oct 2015 10:32:22 -0400 Received: by tranklukator.brq.redhat.com (nbSMTP-1.00) for uid 500 oleg@redhat.com; Mon, 19 Oct 2015 16:28:55 +0200 (CEST) Date: Mon, 19 Oct 2015 16:28:53 +0200 From: Oleg Nesterov To: Pekka Enberg , Sasha Levin , Will Deacon Cc: kvm@vger.kernel.org Subject: [PATCH] kvmtool/term: unexport term_set_tty, term_init, term_exit Message-ID: <20151019142853.GA21583@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP According to git grep they can be static. term_got_escape can be static too, and we can even move it into term_getc(). "int term_escape_char" doesn't make sense at least until we allow to redefine it, turn it into preprocessor constant. Signed-off-by: Oleg Nesterov --- include/kvm/term.h | 3 --- term.c | 15 ++++++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/include/kvm/term.h b/include/kvm/term.h index dc9882e..b9793f0 100644 --- a/include/kvm/term.h +++ b/include/kvm/term.h @@ -18,9 +18,6 @@ int term_putc(char *addr, int cnt, int term); int term_getc(struct kvm *kvm, int term); bool term_readable(int term); -void term_set_tty(int term); -int term_init(struct kvm *kvm); -int term_exit(struct kvm *kvm); int tty_parser(const struct option *opt, const char *arg, int unset); #endif /* KVM__TERM_H */ diff --git a/term.c b/term.c index 9763211..aebd174 100644 --- a/term.c +++ b/term.c @@ -19,15 +19,16 @@ static struct termios orig_term; -int term_escape_char = 0x01; /* ctrl-a is used for escape */ -bool term_got_escape = false; - -int term_fds[TERM_MAX_DEVS][2]; +static int term_fds[TERM_MAX_DEVS][2]; static pthread_t term_poll_thread; +/* ctrl-a is used for escape */ +#define term_escape_char 0x01 + int term_getc(struct kvm *kvm, int term) { + static bool term_got_escape = false; unsigned char c; if (read_in_full(term_fds[term][TERM_FD_IN], &c, 1) < 0) @@ -137,7 +138,7 @@ static void term_sig_cleanup(int sig) raise(sig); } -void term_set_tty(int term) +static void term_set_tty(int term) { struct termios orig_term; int master, slave; @@ -167,7 +168,7 @@ int tty_parser(const struct option *opt, const char *arg, int unset) return 0; } -int term_init(struct kvm *kvm) +static int term_init(struct kvm *kvm) { struct termios term; int i, r; @@ -204,7 +205,7 @@ int term_init(struct kvm *kvm) } dev_init(term_init); -int term_exit(struct kvm *kvm) +static int term_exit(struct kvm *kvm) { return 0; }