From patchwork Fri Aug 1 16:01:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 34723 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B3C4E202A1 for ; Fri, 1 Aug 2014 16:04:36 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id vb8sf18719757obc.0 for ; Fri, 01 Aug 2014 09:04:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-length:content-type :content-transfer-encoding; bh=DeeWNgwicNlpS7bFj2IZrHQeqobaLin8CHVWVojjqJk=; b=Q8WjZCmSJhVZbzatvE57DDu50Tvgch5tbDFMFs/6zWJd1vYbOGnnZSeNJXvUalc6al hccIednKXWfXPyt4UIm/P4GZNL9cJvX9mmlOxPt+b2+MpwnoQzQUwe8qY9nfLogr3HT7 z+DFNEIuFfCWZBXzQ2bt+Gsanb6jJWbOPLfXW/Cl4jPgPelpHK7e4h8Gih1uHTOuzCHh Jd7D9P0oNmd85QoD9ULHmwkXSydUhYvh4fjnnI/ibSQItCMRxpQvO+k7ipK+bxGjZtzo dh1qaZk7mCjTRU+7+YYSxfqwkhiyq+CTWUimXwijKeu53FiR409DyDHTu+jSXmy8LFPL FchQ== X-Gm-Message-State: ALoCoQmQSXRMwp5C/Jc6hEvoYVust6f098pCmbKrn+EkMhsf2lX1DOFIkIU3O2pNFGL62nvHKxov X-Received: by 10.182.213.105 with SMTP id nr9mr2678489obc.36.1406909076156; Fri, 01 Aug 2014 09:04:36 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.136 with SMTP id a8ls1422715qgf.2.gmail; Fri, 01 Aug 2014 09:04:36 -0700 (PDT) X-Received: by 10.220.172.134 with SMTP id l6mr3000447vcz.80.1406909076042; Fri, 01 Aug 2014 09:04:36 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id km11si7706049veb.78.2014.08.01.09.04.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Aug 2014 09:04:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id ik5so7012665vcb.34 for ; Fri, 01 Aug 2014 09:04:36 -0700 (PDT) X-Received: by 10.52.248.146 with SMTP id ym18mr6378498vdc.8.1406909075963; Fri, 01 Aug 2014 09:04:35 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp122081vcb; Fri, 1 Aug 2014 09:04:35 -0700 (PDT) X-Received: by 10.50.4.9 with SMTP id g9mr9087661igg.42.1406909075370; Fri, 01 Aug 2014 09:04:35 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id v8si7403652igd.31.2014.08.01.09.04.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 01 Aug 2014 09:04:35 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XDFHr-0006on-Tb; Fri, 01 Aug 2014 16:02:31 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XDFHq-0006n1-Qx for xen-devel@lists.xenproject.org; Fri, 01 Aug 2014 16:02:30 +0000 Received: from [85.158.139.211:50177] by server-13.bemta-5.messagelabs.com id 9A/C7-20082-61ABBD35; Fri, 01 Aug 2014 16:02:30 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-11.tower-206.messagelabs.com!1406908948!7239432!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3377 invoked from network); 1 Aug 2014 16:02:29 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 1 Aug 2014 16:02:29 -0000 X-IronPort-AV: E=Sophos;i="5.01,780,1400025600"; d="scan'208";a="158517041" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Fri, 1 Aug 2014 12:02:27 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1XDFHh-0006OT-VQ; Fri, 01 Aug 2014 17:02:21 +0100 From: Stefano Stabellini To: Date: Fri, 1 Aug 2014 17:01:11 +0100 Message-ID: <1406908873-17256-1-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-DLP: MIA1 Cc: xen-devel@lists.xensource.com, Stefano Stabellini , qemu-devel@nongnu.org, Anthony Perard , xen-devel@lists.xenproject.org, Roger Pau Monne Subject: [Xen-devel] [PULL 1/3] xen: fix usage of ENODATA X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: From: Roger Pau Monne ENODATA doesn't exist on FreeBSD, so ENODATA errors returned by the hypervisor are translated to ENOENT. Also, the error code is returned in errno if the call returns -1, so compare the error code with the value in errno instead of the value returned by the function. Signed-off-by: Roger Pau Monné Signed-off-by: Stefano Stabellini Cc: xen-devel@lists.xenproject.org Cc: Stefano Stabellini Cc: Anthony Perard --- xen-hvm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xen-hvm.c b/xen-hvm.c index a2486cf..91de2e2 100644 --- a/xen-hvm.c +++ b/xen-hvm.c @@ -513,11 +513,14 @@ static void xen_sync_dirty_bitmap(XenIOState *state, start_addr >> TARGET_PAGE_BITS, npages, bitmap); if (rc < 0) { - if (rc != -ENODATA) { +#ifndef ENODATA +#define ENODATA ENOENT +#endif + if (errno == ENODATA) { memory_region_set_dirty(framebuffer, 0, size); DPRINTF("xen: track_dirty_vram failed (0x" TARGET_FMT_plx ", 0x" TARGET_FMT_plx "): %s\n", - start_addr, start_addr + size, strerror(-rc)); + start_addr, start_addr + size, strerror(errno)); } return; }