From patchwork Wed Jan 14 13:06:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 43108 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5B38F240B9 for ; Wed, 14 Jan 2015 13:09:17 +0000 (UTC) Received: by mail-wi0-f199.google.com with SMTP id bs8sf5076063wib.2 for ; Wed, 14 Jan 2015 05:09:16 -0800 (PST) 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:cc:subject :precedence:list-id:list-unsubscribe:list-post:list-help :list-subscribe:mime-version:content-type:content-transfer-encoding :sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=s5AuyC1GIE7YwYY9wwYPEsg3AZArrE8Joi/+fQo0ZdU=; b=Bw0HZpwHLgyqlR1VC1nuATv8Oyu8KRnKC72QnZfbmgnvRo/mfNVCJfvqI54VzJqinx w26aQPjCSLTmWTmwtx7Kgz0Yo2PcnZRNUD0D3Awyy336uj7uvb06e5aiGj/+Q8hYL59l bYAh7LZxnaVo39i1qRLxABqQomP5ouenLYvnbERAGEoZJie9GdCFP1vj1ShfU8ZaennD eU2RLPpsMWMMhnzXhYVisy43JYsT5uDBbHNLhI7sDEX6Bjf5JFzN1NPZcIT4LpeuwC35 Sl2SKL2k1Cl2Xl10Tz+6jsatg7KbQXy0sM5pwVRP1ChVpw9edHjSZHwUNs5H5eMQUVpZ fJbQ== X-Gm-Message-State: ALoCoQkiE4qoFZn8K/EX91sjWm41BAQRuLkgumOrr7li6SqcmbP4CWuP6c3VdvLxoIacXoWuv34E X-Received: by 10.112.133.98 with SMTP id pb2mr508078lbb.2.1421240956626; Wed, 14 Jan 2015 05:09:16 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.130 with SMTP id b2ls93389laa.27.gmail; Wed, 14 Jan 2015 05:09:16 -0800 (PST) X-Received: by 10.152.23.38 with SMTP id j6mr3803127laf.81.1421240956201; Wed, 14 Jan 2015 05:09:16 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id q2si27146336lbb.130.2015.01.14.05.09.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Jan 2015 05:09:15 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by mail-lb0-f176.google.com with SMTP id p9so7827589lbv.7 for ; Wed, 14 Jan 2015 05:09:15 -0800 (PST) X-Received: by 10.152.23.38 with SMTP id j6mr3803102laf.81.1421240955787; Wed, 14 Jan 2015 05:09:15 -0800 (PST) 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.112.9.200 with SMTP id c8csp1691067lbb; Wed, 14 Jan 2015 05:09:15 -0800 (PST) X-Received: by 10.52.190.40 with SMTP id gn8mr2310121vdc.56.1421240954214; Wed, 14 Jan 2015 05:09:14 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id l11si2320908vdg.32.2015.01.14.05.09.13 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 14 Jan 2015 05:09:14 -0800 (PST) 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 1YBNfQ-0002yF-LX; Wed, 14 Jan 2015 13:07:24 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YBNfQ-0002yA-3s for xen-devel@lists.xenproject.org; Wed, 14 Jan 2015 13:07:24 +0000 Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id C0/6C-15461-B0A66B45; Wed, 14 Jan 2015 13:07:23 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-3.tower-21.messagelabs.com!1421240841!21041275!1 X-Originating-IP: [74.125.82.49] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.12.5; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20564 invoked from network); 14 Jan 2015 13:07:21 -0000 Received: from mail-wg0-f49.google.com (HELO mail-wg0-f49.google.com) (74.125.82.49) by server-3.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 14 Jan 2015 13:07:21 -0000 Received: by mail-wg0-f49.google.com with SMTP id n12so8795672wgh.8 for ; Wed, 14 Jan 2015 05:07:21 -0800 (PST) X-Received: by 10.180.19.138 with SMTP id f10mr48521127wie.56.1421240840791; Wed, 14 Jan 2015 05:07:20 -0800 (PST) Received: from chilopoda.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id fo2sm3309362wib.10.2015.01.14.05.07.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Jan 2015 05:07:19 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 14 Jan 2015 13:06:48 +0000 Message-Id: <1421240808-11793-1-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 2.1.4 Cc: Wei Liu , Julien Grall , Ian Jackson , Ian Campbell , Stefano Stabellini Subject: [Xen-devel] [BACKPORT for 4.4/4.3] libxl: Don't ignore error when we fail to give access to ioport/irq/iomem 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: , MIME-Version: 1.0 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: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 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: If we fail to give the access, the domain will unlikely work correctly. So we should bail out at the first error. Signed-off-by: Julien Grall Cc: Ian Jackson Cc: Stefano Stabellini Cc: Ian Campbell Cc: Wei Liu (Based on commit 7070eec417934360bf3aed434191246dfe4f8091) --- The original patch https://patches.linaro.org/42911/ doesn't applied on Xen 4.4 and Xen 4.3. --- tools/libxl/libxl_create.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index a604cd8..e3350d5 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -1068,6 +1068,7 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev, "failed give dom%d access to ioports %"PRIx32"-%"PRIx32, domid, io->first, io->first + io->number - 1); ret = ERROR_FAIL; + goto error_out; } } @@ -1083,6 +1084,7 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev, if (ret < 0) { LOGE(ERROR, "failed give dom%d access to irq %d", domid, irq); ret = ERROR_FAIL; + goto error_out; } } @@ -1099,6 +1101,7 @@ static void domcreate_launch_dm(libxl__egc *egc, libxl__multidev *multidev, "failed give dom%d access to iomem range %"PRIx64"-%"PRIx64, domid, io->start, io->start + io->number - 1); ret = ERROR_FAIL; + goto error_out; } }