From patchwork Fri Apr 29 14:21:19 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: 8983281 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 69FDBBF29F for ; Fri, 29 Apr 2016 14:24:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 86B91201C8 for ; Fri, 29 Apr 2016 14:24:24 +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 A53FC201C0 for ; Fri, 29 Apr 2016 14:24:23 +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 1aw9If-0005rw-6h; Fri, 29 Apr 2016 14:21:45 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aw9Ie-0005rI-2P for xen-devel@lists.xenproject.org; Fri, 29 Apr 2016 14:21:44 +0000 Received: from [85.158.143.35] by server-3.bemta-6.messagelabs.com id A9/6F-07120-7FD63275; Fri, 29 Apr 2016 14:21:43 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOIsWRWlGSWpSXmKPExsXitHSDve63XOV wg6tXLC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oxf20+zFDTwV3TsP8rawHiYu4uRk0NCwF/i 3pQuRhCbTUBH4uLcnWxdjBwcIgIqErf3GnQxcnEwC1xilNg46RorSI2wQKTEpKUrwOpZBFQlH n7rZAGxeQVcJJZ1/2GFmKkrcXL3JnYQm1PAVWL1infsIDOFgGr2rnWGKBeUODnzCVgrs4CmRO v23+wQtrxE89bZzCC2kICiRP+8B2wQI7klbp+eyjyBkX8WkvZZSNpnIWlfwMi8ilG9OLWoLLV I11gvqSgzPaMkNzEzR9fQwEwvN7W4ODE9NScxqVgvOT93EyMwABmAYAdjxz+nQ4ySHExKorxX dZXDhfiS8lMqMxKLM+KLSnNSiw8xynBwKEnwXssBygkWpaanVqRl5gBjASYtwcGjJMJ7ASTNW 1yQmFucmQ6ROsWoKCXO+wUkIQCSyCjNg2uDxd8lRlkpYV5GoEOEeApSi3IzS1DlXzGKczAqCf PqAaNZiCczrwRu+iugxUxAiwU2KYIsLklESEk1MEYpTJj2NNRyQUq0o9Av41/+D65YFVxjvan LkWmTfuEg7332228evlQ7kXe6/eBG1sBNt+y/C0k230zal7D3mNlCey/JmC2BuxdOUDTvTtE4 mJNUbZGlFSx65+NJ6T3ND3NZPrLu2fK1V+V2js+idS2sbZbvtlVOOXs5/adki5PU6WOLg1cGl CuxFGckGmoxFxUnAgConWU3ugIAAA== X-Env-Sender: prvs=9202e7170=roger.pau@citrix.com X-Msg-Ref: server-4.tower-21.messagelabs.com!1461939701!5872639!1 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 39059 invoked from network); 29 Apr 2016 14:21:42 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-4.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 29 Apr 2016 14:21:42 -0000 X-IronPort-AV: E=Sophos;i="5.24,552,1454976000"; d="scan'208";a="357384861" From: Roger Pau Monne To: Date: Fri, 29 Apr 2016 16:21:19 +0200 Message-ID: <1461939680-32574-4-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 2.6.4 (Apple Git-63) In-Reply-To: <1461939680-32574-1-git-send-email-roger.pau@citrix.com> References: <1461939680-32574-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 for-4.7 3/4] 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é --- 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 695be7f..b31115c 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;