From patchwork Wed Sep 21 19:20:30 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: 9344157 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 35370601C2 for ; Wed, 21 Sep 2016 19:23:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2640E2A841 for ; Wed, 21 Sep 2016 19:23:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AD1B2A85A; Wed, 21 Sep 2016 19:23:14 +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 0DAAB2A841 for ; Wed, 21 Sep 2016 19:23:13 +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 1bmn4h-0004yn-Mq; Wed, 21 Sep 2016 19:20:55 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bmn4g-0004yZ-IW for xen-devel@lists.xenproject.org; Wed, 21 Sep 2016 19:20:54 +0000 Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id 05/EB-03271-59DD2E75; Wed, 21 Sep 2016 19:20:53 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBLMWRWlGSWpSXmKPExsXSO6nOVXfq3Uf hBnfPCFh83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBmNF/ULJnJUfNvdwdjA+JO1i5GLQ0hgIpPE 4ucdUM5vRokfUw9BORsZJebuuMUC4fQzSjQ86wPKcHCwCZhIvFnl2MXIySEiECHR+/IUC4jNL JAlcfxDCxNIibBAmMTsF0UgYRYBVYm9L/czg9i8Am4SFyYuZgYpkRCQl3h2ux4kzCngLnF0yz YmEFsIqOTA1HnsILaEgKHE541LmScw8i1gZFjFqF6cWlSWWqRrqZdUlJmeUZKbmJmja2hgrJe bWlycmJ6ak5hUrJecn7uJERgi9QwMjDsYX/90OsQoycGkJMrbveVRuBBfUn5KZUZicUZ8UWlO avEhRhkODiUJXqY7QDnBotT01Iq0zBxgsMKkJTh4lER460HSvMUFibnFmekQqVOMilLivJ4gC QGQREZpHlwbLEIuMcpKCfMyMjAwCPEUpBblZpagyr9iFOdgVBLmFQKZwpOZVwI3/RXQYiagxV t+PgBZXJKIkJJqYCw8ExTDuuWf5IPmIOHog5FJejvnv7G88ynjh8XHC8e2Lvx2tMiafVpdYmv BRaHjolqPrB1OLOK+FDt9uaiLpGmzyeIvfHvmhdolGBfO92yrnVK2cukn9R9/JHd/3HHtuOfn l4zF5p+Xz7fjTJokwfae/5S5fafm45VlKZf5s1a/3TLzgfyLFcZKLMUZiYZazEXFiQAHQPNsi wIAAA== X-Env-Sender: konrad.wilk@oracle.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1474485651!61970268!1 X-Originating-IP: [141.146.126.69] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTQxLjE0Ni4xMjYuNjkgPT4gMjc3MjE4\n X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23669 invoked from network); 21 Sep 2016 19:20:53 -0000 Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by server-3.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 21 Sep 2016 19:20:53 -0000 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u8LJKjMY010810 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 21 Sep 2016 19:20:46 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.13.8) with ESMTP id u8LJKjsq011579 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 21 Sep 2016 19:20:45 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 u8LJKjED003535; Wed, 21 Sep 2016 19:20:45 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:44 -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:30 -0400 Message-Id: <1474485630-24113-4-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: userv0022.oracle.com [156.151.31.74] Cc: ian.jackson@eu.citrix.com, wei.liu2@citrix.com, Konrad Rzeszutek Wilk Subject: [Xen-devel] [PATCH v1 3/3] xen-livepatch: If hypervisor is not compiled with Livepatching 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 . print a better error code. Reported-by: Andrew Cooper Signed-off-by: Konrad Rzeszutek Wilk --- tools/misc/xen-livepatch.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/misc/xen-livepatch.c b/tools/misc/xen-livepatch.c index 2de04c0..f11e71f07f 100644 --- a/tools/misc/xen-livepatch.c +++ b/tools/misc/xen-livepatch.c @@ -100,8 +100,11 @@ static int list_func(int argc, char *argv[]) rc = xc_livepatch_list(xch, MAX_LEN, idx, info, name, len, &done, &left); if ( rc ) { - fprintf(stderr, "Failed to list %d/%d: %d(%s)!\n", - idx, left, errno, strerror(errno)); + if ( errno == ENOSYS ) + fprintf(stderr, "Hypervisor compiled without Xen Livepatching!\n"); + else + fprintf(stderr, "Failed to list %d/%d: %d(%s)!\n", + idx, left, errno, strerror(errno)); break; } if ( !idx )