From patchwork Thu Feb 23 23:12:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Gao X-Patchwork-Id: 9589439 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A0E82601AE for ; Fri, 24 Feb 2017 06:16:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A2AE2879A for ; Fri, 24 Feb 2017 06:16:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EFE6287A1; Fri, 24 Feb 2017 06:16:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00, DATE_IN_PAST_06_12, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 1C9FF287A2 for ; Fri, 24 Feb 2017 06:16:36 +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 1ch98i-0001JT-Qe; Fri, 24 Feb 2017 06:14:00 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ch98h-0001JL-V8 for xen-devel@lists.xen.org; Fri, 24 Feb 2017 06:14:00 +0000 Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id 1B/07-23940-72FCFA85; Fri, 24 Feb 2017 06:13:59 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMIsWRWlGSWpSXmKPExsXS1tYhoqt2fn2 EwY4behZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8aRdSvYCyazVWw/9I6tgXEaaxcjF4eQwHRG iRkrbgM5nBwSArwSR5bNgLL9JJ4ueQRmCwmUS9zb280MYrMIqEp8+DmVDcRmE1CWuPi1F8wWE ZCWuPb5MiOIzSzgJXHo8D4mEFtYwFuiZ/lhsBpeAUuJv7Ob2SHsIok1784zQdiCEidnPmGB6N WSuPHvJVCcA8iWllj+jwMkLCqgIjHl5Da2CYz8s5B0zELSMQuhYwEj8ypG9eLUorLUIl1zvaS izPSMktzEzBxdQwNjvdzU4uLE9NScxKRiveT83E2MwABkAIIdjI3fnQ4xSnIwKYnyKuxYHyHE l5SfUpmRWJwRX1Sak1p8iFGGg0NJgjfxHFBOsCg1PbUiLTMHGAswaQkOHiUR3m9ngNK8xQWJu cWZ6RCpU4y6HDeOH3jDJMSSl5+XKiXOawkyQwCkKKM0D24ELC4vMcpKCfMyAh0lxFOQWpSbWY Iq/4pRnINRSZhXD2QKT2ZeCdymV0BHMAEdYem8FuSIkkSElFQDo/6y2ZIzzRhLtxfGKj8t/X8 /TZjDTe/jgnb7NslIp/SZ1yZs4TUOmWr1tvTw749n73y5vEH+xwW97piZ5+WDp2bNM2h/pLvx ZebpSw8TZrZsPfQ2XfHSP/OSog+thXwWWb0/nmbce7SxR29C9G+zTVMOivEtsiu8kONecqza4 tO6rS9dzj+4/EOJpTgj0VCLuag4EQDKy++bxgIAAA== X-Env-Sender: chao.gao@intel.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1487916836!87193101!1 X-Originating-IP: [134.134.136.20] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTM0LjEzNC4xMzYuMjAgPT4gMzU1MzU4\n X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 44690 invoked from network); 24 Feb 2017 06:13:58 -0000 Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by server-3.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 24 Feb 2017 06:13:58 -0000 Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Feb 2017 22:13:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,200,1484035200"; d="scan'208";a="69045276" Received: from skl-2s3.sh.intel.com ([10.239.48.35]) by fmsmga005.fm.intel.com with ESMTP; 23 Feb 2017 22:13:53 -0800 Date: Fri, 24 Feb 2017 07:12:10 +0800 From: Chao Gao To: xen-devel@lists.xen.org Message-ID: <20170223231208.GA18953@skl-2s3.sh.intel.com> Mail-Followup-To: xen-devel@lists.xen.org, Wei Liu , Ian Jackson MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Ian Jackson , Wei Liu Subject: [Xen-devel] [PATCH] libxl/libxl_pci.c: Fix reverse logic when detaching device 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-Virus-Scanned: ClamAV using ClamSMTP Commit 20b75251d97 ("libxl/libxl_pci.c: used LOG*D functions") reverses the logic to call xc_deassign_device(). It makes the device unusable. Signed-off-by: Chao Gao --- tools/libxl/libxl_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index 8395352..b14df16 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -1370,7 +1370,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid, int hvm = 0, rc, num; int stubdomid = 0; uint32_t domainid = domid; - bool isstubdom = !libxl_is_stubdom(ctx, domid, &domainid); + bool isstubdom = libxl_is_stubdom(ctx, domid, &domainid); assigned = libxl_device_pci_list(ctx, domid, &num);