From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA623C4361A for ; Fri, 4 Dec 2020 11:27:01 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 49BD622581 for ; Fri, 4 Dec 2020 11:27:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 49BD622581 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.44507.79736 (Exim 4.92) (envelope-from ) id 1kl9Eb-0001oC-T9; Fri, 04 Dec 2020 11:26:45 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 44507.79736; Fri, 04 Dec 2020 11:26:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kl9Eb-0001o5-QK; Fri, 04 Dec 2020 11:26:45 +0000 Received: by outflank-mailman (input) for mailman id 44507; Fri, 04 Dec 2020 11:26:45 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kl9Eb-0001o0-6K for xen-devel@lists.xenproject.org; Fri, 04 Dec 2020 11:26:45 +0000 Received: from mail-wr1-f68.google.com (unknown [209.85.221.68]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 6c303893-563c-4cb7-a3a6-7b303daa7b34; Fri, 04 Dec 2020 11:26:43 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id 91so1019886wrj.7 for ; Fri, 04 Dec 2020 03:26:43 -0800 (PST) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id b11sm2235812wrs.84.2020.12.04.03.26.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2020 03:26:41 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6c303893-563c-4cb7-a3a6-7b303daa7b34 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=DegQS7TWt3u4cw5soBD9Ag1ldmEawFj2H5tQVuxrhUs=; b=imGSsAA2nbclZMSTPZy6qlumAw70ZsuRQ+s8dInZeF+lvLKTKu4qfktEW2SNuVFKly dnjBIyWLJAXVpQz90bT+nLqqTFUXetayHNTWT4r6k3BGVoAepFZUnHKbhDGNmxNFYRKY Bh4fyknk1XUcOYJUZcXx1SnZs9hfmVvBaI1Av3K51QwkP/dQ3wabLeiV348UVKb2Abz4 4u0MpoCBcPhu/eTP6sVF7oc50ON7d7CWYZeSGtEyfMKZo+hG24CBPhFFpwSZf2XjO2wZ pTGVUXUTiJ4Zt/HKuU+koFJU0MEHJWfIbsxe8MusbJ6ys1ur7cLqFTuszxdGrHzfyZCn pt1g== X-Gm-Message-State: AOAM532I8T3uYC1Ed0sPx8IV+75DCydd/wTnth3fU5lf9h4lV1FDmtNf sAI6M1tABOGXpPHjXdbXL00= X-Google-Smtp-Source: ABdhPJwBE9eMkFnYC9WQfWhZtc3YTvZRxUtUYgdtgmqNnjjNxL4Nv2zbrkfJmOw4p19I2tHx0PsTRA== X-Received: by 2002:a5d:634d:: with SMTP id b13mr4484603wrw.310.1607081202506; Fri, 04 Dec 2020 03:26:42 -0800 (PST) Date: Fri, 4 Dec 2020 11:26:40 +0000 From: Wei Liu To: Paul Durrant Cc: xen-devel@lists.xenproject.org, Paul Durrant , Oleksandr Andrushchenko , Ian Jackson , Wei Liu Subject: Re: [PATCH v5 10/23] libxl: remove get_all_assigned_devices() from libxl_pci.c Message-ID: <20201204112640.5ucp2oazwjbla6e3@liuwe-devbox-debian-v2> References: <20201203142534.4017-1-paul@xen.org> <20201203142534.4017-11-paul@xen.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201203142534.4017-11-paul@xen.org> User-Agent: NeoMutt/20180716 On Thu, Dec 03, 2020 at 02:25:21PM +0000, Paul Durrant wrote: > From: Paul Durrant > > Use of this function is a very inefficient way to check whether a device > has already been assigned. > > This patch adds code that saves the domain id in xenstore at the point of > assignment, and removes it again when the device id de-assigned (or the > domain is destroyed). It is then straightforward to check whether a device > has been assigned by checking whether a device has a saved domain id. > > NOTE: To facilitate the xenstore check it is necessary to move the > pci_info_xs_read() earlier in libxl_pci.c. To keep related functions > together, the rest of the pci_info_xs_XXX() functions are moved too. > > Signed-off-by: Paul Durrant > Reviewed-by: Oleksandr Andrushchenko Acked-by: Wei Liu