From patchwork Mon Jun 29 19:25:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 489379 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D8ACE1402A3 for ; Tue, 30 Jun 2015 05:29:39 +1000 (AEST) Received: from localhost ([::1]:43678 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9ekM-0002WH-2G for incoming@patchwork.ozlabs.org; Mon, 29 Jun 2015 15:29:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9eju-0001rr-5S for qemu-devel@nongnu.org; Mon, 29 Jun 2015 15:29:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9ejq-0005Y3-S8 for qemu-devel@nongnu.org; Mon, 29 Jun 2015 15:29:10 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:39432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9egF-0004ie-JN for qemu-devel@nongnu.org; Mon, 29 Jun 2015 15:25:24 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t5TJPH5u011112 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 29 Jun 2015 19:25:17 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t5TJPHNr021769 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 29 Jun 2015 19:25:17 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t5TJPGa9003877; Mon, 29 Jun 2015 19:25:16 GMT Received: from l.oracle.com (/10.137.176.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 29 Jun 2015 12:25:16 -0700 Received: by l.oracle.com (Postfix, from userid 1000) id 56A256A0266; Mon, 29 Jun 2015 15:25:15 -0400 (EDT) From: Konrad Rzeszutek Wilk To: stefano.stabellini@eu.citrix.com, xen-devel@lists.xenproject.org, qemu-devel@nongnu.org Date: Mon, 29 Jun 2015 15:25:10 -0400 Message-Id: <1435605913-23826-4-git-send-email-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1435605913-23826-1-git-send-email-konrad.wilk@oracle.com> References: <1435605913-23826-1-git-send-email-konrad.wilk@oracle.com> X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 156.151.31.81 Cc: Konrad Rzeszutek Wilk Subject: [Qemu-devel] [PATCH RFC 3/6] xen/pt: xen_host_pci_config_read returns -errno, not -1 on failure 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 However the init routines assume that on errors the return code is -1 (as the libxc API is) - while those xen_host_* routines follow another paradigm - negative errno on return, 0 on success. Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Stefano Stabellini --- hw/xen/xen_pt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index 706e3d9..ea1ceda 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -716,7 +716,7 @@ static int xen_pt_initfn(PCIDevice *d) /* Initialize virtualized PCI configuration (Extended 256 Bytes) */ if (xen_host_pci_get_block(&s->real_device, 0, d->config, - PCI_CONFIG_SPACE_SIZE) == -1) { + PCI_CONFIG_SPACE_SIZE) < 0) { xen_host_pci_device_put(&s->real_device); return -1; }