[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] xen: add domid_to_domain() helper


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 12 Sep 2022 10:34:23 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SwAjpLWz7zLWGNC8h48U8N86qrSvD1eKwMZ9h40wuSA=; b=X23Ui/s4FbGPjSc6ODG5ExP8yC3gQ8GcTGp3xrkIK72w4eM0g4Rxt+XMljhzWHt19qPfDfy4MaycTzx7hN2MrcRllulD+ppi0wcn2ZRAgB1B8++1KQOFgQioh0tg3O/X6Y2Vv3R66UkRyYvqRcDcwhh66IqltEDGpHvHMpDUWGYnPn7Vz9jUni9gZlrimZzyTUwY/g8SFzaEA7MHRp9EZ+5KvDiekBXV+Cfx1Q3EWTq+93C4RDCG+Y3UH+J90zAYzKhKbjrMON1YZ9w6O1MA2vnIQXTdg7jTPLRrF5mmvgIzYV1yKCyWa4MiOIEW2+hGeM3sweQnQP7muPt9J/au9A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UPRIlbnOaD9hOu0OFdA25+Nj06aO3U95Cf0ljKYuU93Pd3n7l9SdTjerVmexeJaYWXZQzqd5LxrRomdbTh/tOrMek5y6pKTmxywqtgNzgk2bFpvPvGuAbeqWAAhSVeHmUFMA2zfP7bp9vbHQxirlR9KS8PiJpICbz+LbdZbpGSrHDiKJSIjYIBthr5QUXGSTHu8pcpsPMvBrBaqPlXs2dIyyQhxI6KZv1tDGGSfeeIRw9SG0DgdUPbqfroi0R4zeT9BUoUlcToDCMhkgLH4gZ0+/kAoZ2r1TSdPuHUBjdYTSQkFxskDPXgwfLv+XAMsyNE4U8O2Iwkhwo7LyFUULUQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 12 Sep 2022 08:34:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12.09.2022 10:33, Juergen Gross wrote:
> On 12.09.22 10:31, Jan Beulich wrote:
>> On 12.09.2022 10:23, Juergen Gross wrote:
>>> On 12.09.22 10:19, Jan Beulich wrote:
>>>> On 12.09.2022 07:53, Juergen Gross wrote:
>>>>> Add a helper domid_to_domain() returning the struct domain pointer for
>>>>> a domain give by its domid and which is known not being able to be
>>>>> released (its reference count isn't incremented and no rcu_lock_domain()
>>>>> is called for it).
>>>>>
>>>>> In order to simplify coding add an internal helper for doing the lookup
>>>>> and call that from the new function and similar functions.
>>>>>
>>>>> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
>>>>
>>>> I don't see an issue with adding such a helper (responding to your concern
>>>> in the cover letter), but I think the constraints need to be empahsized
>>>> more: We already have get_knownalive_domain() and get_domain_by_id(), so
>>>> how about naming the new helper get_knownalive_domain_by_id()? And then ...
>>>
>>> I explicitly didn't name it "get_...", as those helpers all increment the
>>> reference count of the domain. And this is NOT done by the new helper.
>>
>> Hmm, agreed. But domid_to_domain() isn't expressing the "known alive" aspect,
>> yet that's relevant to see when reviewing new uses of the function. Such uses
>> aren't likely to make the reviewer go look at the function declaration when
>> the function name is pretty "innocent".
> 
> Okay, what about domid_to_knownalive_domain()?
> 
> Or knownalive_domain_from_domid()?

Either would be fine with me.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.