[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
> 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 copied. — Christian _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |