From patchwork Tue Apr 15 08:33:08 2014 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: 339199 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 24B03140089 for ; Tue, 15 Apr 2014 18:34:01 +1000 (EST) Received: from localhost ([::1]:47573 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZyoY-0002TV-W8 for incoming@patchwork.ozlabs.org; Tue, 15 Apr 2014 04:33:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZyo0-0001ZC-7z for qemu-devel@nongnu.org; Tue, 15 Apr 2014 04:33:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WZynp-0005BP-Py for qemu-devel@nongnu.org; Tue, 15 Apr 2014 04:33:24 -0400 Received: from smtp.citrix.com ([66.165.176.89]:3258) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WZynp-0005Au-M5 for qemu-devel@nongnu.org; Tue, 15 Apr 2014 04:33:13 -0400 X-IronPort-AV: E=Sophos;i="4.97,862,1389744000"; d="scan'208";a="121155925" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 15 Apr 2014 08:33:12 +0000 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.123.3; Tue, 15 Apr 2014 04:33:12 -0400 Received: from gateway-cbg.eng.citrite.net ([10.80.16.17] helo=localhost.localdomain) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1WZynn-0002xg-Lb; Tue, 15 Apr 2014 09:33:11 +0100 From: Roger Pau Monne To: , Date: Tue, 15 Apr 2014 10:33:08 +0200 Message-ID: <1397550789-43232-2-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 1.7.7.5 (Apple Git-26) In-Reply-To: <1397550789-43232-1-git-send-email-roger.pau@citrix.com> References: <1397550789-43232-1-git-send-email-roger.pau@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.89 Cc: Anthony Perard , Stefano Stabellini , Roger Pau Monne Subject: [Qemu-devel] [PATCH 1/2] xen: fix usage of ENODATA X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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é Cc: xen-devel@lists.xenproject.org Cc: Stefano Stabellini Cc: Anthony Perard --- xen-all.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xen-all.c b/xen-all.c index 0b4d934..4026b7b 100644 --- a/xen-all.c +++ b/xen-all.c @@ -499,11 +499,15 @@ static void xen_sync_dirty_bitmap(XenIOState *state, start_addr >> TARGET_PAGE_BITS, npages, bitmap); if (rc < 0) { - if (rc != -ENODATA) { +#ifdef ENODATA + if (errno == ENODATA) { +#else + if (errno == ENOENT) { +#endif 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; }