Hello - I was just writing some code using the xenctrl library. During my testing, I was hitting some error cases in the event channel support but not realizing it due to a problem in the API. Several of the event channel API''s (_bind_unbound_port, _bind_interdomain, _bind_virq, and _pending in xenctrl.h) state that they return -1 on error. As it turns out, however, the return value type (evtchn_port_t, which is uint32_t in event_channel.h) is unsigned. Thus, testing for < 0 on the return type will always fail, because there are no negative numbers for the type. I don''t have a patch, because I''m not sure how you think this is best fixed, but just wanted to give you a heads up. Adam Wick Galois, Inc. awick@galois.com _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 13/8/07 23:02, "Adam Wick" <awick@galois.com> wrote:> Several of the event channel API''s (_bind_unbound_port, > _bind_interdomain, _bind_virq, and _pending in xenctrl.h) state that > they return -1 on error. As it turns out, however, the return value > type (evtchn_port_t, which is uint32_t in event_channel.h) is > unsigned. Thus, testing for < 0 on the return type will always fail, > because there are no negative numbers for the type. > > I don''t have a patch, because I''m not sure how you think this is best > fixed, but just wanted to give you a heads up.I''m happy to guarantee that an event channel identifier will always fit in 31 bits, and hence can be represented by ''int'' type on any architectural ABI that we potentially care about. I''ll do a patch. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel