From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v3 20/24] xen/passthrough: Extend XEN_DOMCTL_assign_device to support DT device Date: Thu, 29 Jan 2015 11:45:46 +0000 Message-ID: <54CA1D6A.8000609@linaro.org> References: <1421159133-31526-1-git-send-email-julien.grall@linaro.org> <1421159133-31526-21-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YGnY8-0004Pu-Hr for xen-devel@lists.xenproject.org; Thu, 29 Jan 2015 11:46:16 +0000 Received: by mail-wg0-f47.google.com with SMTP id n12so23005298wgh.6 for ; Thu, 29 Jan 2015 03:46:15 -0800 (PST) In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: Wei Liu , ian.campbell@citrix.com, tim@xen.org, Ian Jackson , stefano.stabellini@citrix.com, Jan Beulich , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org Hi Stefano, On 29/01/15 10:29, Stefano Stabellini wrote: >> +static bool_t iommu_dt_device_is_assigned(const struct dt_device_node *dev) >> +{ >> + bool_t assigned = 0; >> + >> + if ( !dt_device_is_protected(dev) ) >> + return 1; > > Why return true here? Because any device not protected cannot be assigned to another guest. This could be used by the toolstack to know whether the device is assigned or not. IHMO, returning 0 would be a false negative. Would a comment in the code suitable? Regards, -- Julien Grall