From patchwork Tue May 3 10:55:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 9002751 Return-Path: X-Original-To: patchwork-xen-devel@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 ED4869F372 for ; Tue, 3 May 2016 10:57:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 22F99201C7 for ; Tue, 3 May 2016 10:57:25 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 1FA3F201B4 for ; Tue, 3 May 2016 10:57:24 +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 1axXzD-0000WP-50; Tue, 03 May 2016 10:55:27 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axXzB-0000VR-JT for xen-devel@lists.xenproject.org; Tue, 03 May 2016 10:55:25 +0000 Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id 6B/75-03753-C9388275; Tue, 03 May 2016 10:55:24 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOIsWRWlGSWpSXmKPExsXitHSDve6cZo1 wg7O/RSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1oytlyawFDTwV9x5sZ65gfEwdxcjJ4eEgL9E 06HH7CA2m4COxMW5O9m6GDk4RARUJG7vNehi5OJgFrjEKLFx0jVWkBphgRiJRc/+gdWzANX8+ 3EVzOYVcJG4t+IZE8RMXYmTuzexg8zhFHCVaLxnABIWAiqZOaGXDaJcUOLkzCcsIDazgKZE6/ bf7BC2vETz1tnMEPWKEv3zHrBBjOSWuH16KvMERv5ZSNpnIWmfhaR9ASPzKkb14tSistQiXUu 9pKLM9IyS3MTMHF1DQxO93NTi4sT01JzEpGK95PzcTYzAAGQAgh2M/VOcDzFKcjApifJK3FUP F+JLyk+pzEgszogvKs1JLT7EKMPBoSTBW92kES4kWJSanlqRlpkDjAWYtAQHj5IIbzNImre4I DG3ODMdInWKUVFKnLceJCEAksgozYNrg8XfJUZZKWFeRqBDhHgKUotyM0tQ5V8xinMwKgnz9o JM4cnMK4Gb/gpoMRPQ4uz1qiCLSxIRUlINjFIHDtlduvRLevJykVsSik/Ztb4tET0s5TdBUmL zI49n2TUnL7m4a+pFHWPbInSqb6/CmwV5jfPDD3m0uaXvm+b/VnznYvU1K3Vs5xSoz8vyfaV+ +W7Hqt/t04OjzwSnyN2TsT92V2IBS9/pmbbKraVbd96YsUNg9ebdK60a30x9fnzbkp41G2cqs RRnJBpqMRcVJwIAr+MX97oCAAA= X-Env-Sender: prvs=924d4b44a=roger.pau@citrix.com X-Msg-Ref: server-12.tower-27.messagelabs.com!1462272917!39248900!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 41800 invoked from network); 3 May 2016 10:55:23 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-12.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 3 May 2016 10:55:23 -0000 X-IronPort-AV: E=Sophos;i="5.24,572,1454976000"; d="scan'208";a="358033670" From: Roger Pau Monne To: Date: Tue, 3 May 2016 12:55:07 +0200 Message-ID: <1462272910-41200-4-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 2.6.4 (Apple Git-63) In-Reply-To: <1462272910-41200-1-git-send-email-roger.pau@citrix.com> References: <1462272910-41200-1-git-send-email-roger.pau@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Ross Lagerwall , Ian Jackson , Wei Liu , Roger Pau Monne Subject: [Xen-devel] [PATCH v2 for-4.7 3/6] tools/xsplice: fix mixing system errno values with Xen ones. 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Avoid using system errno values when comparing with Xen errno values. Signed-off-by: Roger Pau Monné Acked-by: Wei Liu Reviewed-by: Konrad Rzeszutek Wilk --- Cc: Konrad Rzeszutek Wilk Cc: Ross Lagerwall Cc: Ian Jackson Cc: Wei Liu --- Using errno values inside of hypercall structs is not right IMHO, but there are already several occurrences of this. Although I'm adding the correct XEN_ prefixes here, it's very likely that new additions/modifications to this file will not take this into account, breaking it for OSes != Linux. --- tools/misc/xen-xsplice.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/misc/xen-xsplice.c b/tools/misc/xen-xsplice.c index 598e492..81e422e 100644 --- a/tools/misc/xen-xsplice.c +++ b/tools/misc/xen-xsplice.c @@ -13,6 +13,8 @@ #include #include +#include + static xc_interface *xch; void show_help(void) @@ -233,7 +235,7 @@ struct { .function = xc_xsplice_revert, }, { .allow = XSPLICE_STATE_CHECKED, - .expected = -ENOENT, + .expected = -XEN_ENOENT, .name = "unload", .function = xc_xsplice_unload, }, @@ -276,7 +278,7 @@ int action_func(int argc, char *argv[], unsigned int idx) name, errno, strerror(errno)); return -1; } - if ( status.rc == -EAGAIN ) + if ( status.rc == -XEN_EAGAIN ) { fprintf(stderr, "%s failed. Operation already in progress\n", name); return -1; @@ -319,7 +321,7 @@ int action_func(int argc, char *argv[], unsigned int idx) if ( status.state != original_state ) break; - if ( status.rc && status.rc != -EAGAIN ) + if ( status.rc && status.rc != -XEN_EAGAIN ) { rc = status.rc; break;