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

Re: [Xen-devel] [PATCH] tools/oxenstored: port XS_INTRODUCE evtchn rebind function from cxenstored

  • To: Igor Druzhinin <igor.druzhinin@xxxxxxxxxx>
  • From: Christian Lindig <christian.lindig@xxxxxxxxxx>
  • Date: Tue, 20 Aug 2019 12:11:25 +0000
  • Accept-language: en-GB, en-US
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=christian.lindig@xxxxxxxxxx; spf=Pass smtp.mailfrom=christian.lindig@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxx>, "wl@xxxxxxx" <wl@xxxxxxx>, David Scott <dave@xxxxxxxxxx>
  • Delivery-date: Tue, 20 Aug 2019 12:11:34 +0000
  • Ironport-sdr: Ko9p0fvXznywdC+hAvs3bfoSHqkNuLnAXNKfzxO/5E2DE7OuZncbvX64mT98Uw+PmhavVjttbr 366rfEVcxUxtZ2NjecVbjT4flE31ckhB6u2+mRIH6sIFsFIW+Sa8/2iaUi8e35IaZnQiOzM+wu wP4KZJvOzzg7JSqJ9yBql6Tzz+vszAVOdm03QCB3ZYVjlwnzhyfhOLZVfv27pENo/iQj5/grd4 f9e92V2PofUXOqLfF0Y7vlaCw9739M+3Jej8LVPqXBeALdJeinTyWW3at8NXNukum1e/X88OaI RRg=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVVr5MK6au/yYrc0WquZUXd0SG76cDkYSAgAAoOACAABgFAA==
  • Thread-topic: [PATCH] tools/oxenstored: port XS_INTRODUCE evtchn rebind function from cxenstored

> On 20 Aug 2019, at 11:45, Igor Druzhinin <igor.druzhinin@xxxxxxxxxx> wrote:
> On 20/08/2019 09:21, Christian Lindig wrote:
>>> +                   if (Domain.get_mfn edom) = mfn && 
>>> (Connections.find_domain cons domid) != con then begin
>> This should use <> instead of != because != is pointer inequality in OCaml. 
>> The parentheses are not strictly necessary because function application has 
>> precedence. So:
>>      if Domain.get_mfn edom = mfn && Connections.find_domain cons domid <> 
>> con then begin
> But I actually want to compare pointers here - the idea is that the
> connection object in the hashtable indexed by domid is not the same as
> connection that we got XS_INTRODUCE message from. (see
> tools/xenstore/xenstrored_domain.c)

In your code, a != b is true, if a and b have identical structure but different 
addresses. I strongly suspect that two connection values should have different 
structure to be considered different, not just different addresses. When a <> b 
is true, it implies a != b. So using a <> b is safe(r). By using != you would 
rely on an invariant that every connection (con) exists only once and is never 

— Christian

Xen-devel mailing list



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