From patchwork Wed Sep 21 19:20:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 9344155 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 31034601C2 for ; Wed, 21 Sep 2016 19:23:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21D742A841 for ; Wed, 21 Sep 2016 19:23:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16A972A854; Wed, 21 Sep 2016 19:23:10 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D44092A841 for ; Wed, 21 Sep 2016 19:23:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bmn4e-0004xk-45; Wed, 21 Sep 2016 19:20:52 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bmn4c-0004x1-SM for xen-devel@lists.xenproject.org; Wed, 21 Sep 2016 19:20:50 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id ED/6B-13744-29DD2E75; Wed, 21 Sep 2016 19:20:50 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrFLMWRWlGSWpSXmKPExsUyZ7p8oO7Eu4/ CDR6/ULH4vmUykwOjx+EPV1gCGKNYM/OS8isSWDN2HV7FVrCMs+Lch0mMDYzL2boYuTiEBNqY JLZvPskM4XxhlPj5rIkJwtnIKPGwdS0jhNPPKDHz/A+gHg4ONgETiTerHLsYOTlEBCIkel+eY gGxmQWyJI5/aGECsYUFYiX+/jzLCmKzCKhKdDd0MoLYvAJuEu+3z2UBGSMhIC/x7HY9SJhTwF 3i6JZtYK1CQCUHps5jB7ElBAwlTj/cxjiBkW8BI8MqRvXi1KKy1CJdS72kosz0jJLcxMwcXUM DM73c1OLixPTUnMSkYr3k/NxNjMAwYQCCHYx3NwUcYpTkYFIS5e3e8ihciC8pP6UyI7E4I76o NCe1+BCjDAeHkgQv0x2gnGBRanpqRVpmDjBgYdISHDxKIryTbgOleYsLEnOLM9MhUqcYFaXEe c+DJARAEhmleXBtsCi5xCgrJczLCHSIEE9BalFuZgmq/CtGcQ5GJWFeIZDtPJl5JXDTXwEtZg JavOXnA5DFJYkIKakGxuwlTSEFZ55vcD8/60rHgS/fQ13ZWIxnpDytbWOduSr924r0C1v0rt9 eGHqs7vT5fqumekff78GOiRfMIp7E2U9de9hut0tiR1P7l7vbuSdemaVp8JTROkxcIo07e/UT rpO1ad2dH9ybfROWnjUNm+dwa1uVS69ySm9hs47Bid0e237d7gjjUGIpzkg01GIuKk4EABCRQ j2NAgAA X-Env-Sender: konrad.wilk@oracle.com X-Msg-Ref: server-16.tower-21.messagelabs.com!1474485647!29918520!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 59148 invoked from network); 21 Sep 2016 19:20:49 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-16.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 21 Sep 2016 19:20:49 -0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u8LJKiOs005462 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 21 Sep 2016 19:20:44 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u8LJKiHF017221 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 21 Sep 2016 19:20:44 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u8LJKh9O003529; Wed, 21 Sep 2016 19:20:44 GMT Received: from localhost.us.oracle.com (/10.154.159.51) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 21 Sep 2016 12:20:43 -0700 From: Konrad Rzeszutek Wilk To: xen-devel@lists.xenproject.org, konrad@kernel.org, ross.lagerwall@citrix.com Date: Wed, 21 Sep 2016 15:20:29 -0400 Message-Id: <1474485630-24113-3-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1474485630-24113-1-git-send-email-konrad.wilk@oracle.com> References: <1474485630-24113-1-git-send-email-konrad.wilk@oracle.com> X-Source-IP: userv0021.oracle.com [156.151.31.71] Cc: ian.jackson@eu.citrix.com, wei.liu2@citrix.com, Konrad Rzeszutek Wilk Subject: [Xen-devel] [PATCH v1 2/3] xen-livepatch: Print the header _after_ the first livepatch hypercall X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP That way we can print out the header if we are sure the hypervisor has been compiled with Xen Livepatching. Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Ross Lagerwall --- tools/misc/xen-livepatch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/misc/xen-livepatch.c b/tools/misc/xen-livepatch.c index 7512a98..2de04c0 100644 --- a/tools/misc/xen-livepatch.c +++ b/tools/misc/xen-livepatch.c @@ -91,8 +91,6 @@ static int list_func(int argc, char *argv[]) return rc; } - fprintf(stdout," ID | status\n" - "----------------------------------------+------------\n"); do { done = 0; /* The memset is done to catch errors. */ @@ -106,6 +104,10 @@ static int list_func(int argc, char *argv[]) idx, left, errno, strerror(errno)); break; } + if ( !idx ) + fprintf(stdout," ID | status\n" + "----------------------------------------+------------\n"); + for ( i = 0; i < done; i++ ) { unsigned int j;