WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Event Channel API Oops

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Event Channel API Oops
From: Adam Wick <awick@xxxxxxxxxx>
Date: Mon, 13 Aug 2007 15:02:12 -0700
Delivery-date: Mon, 13 Aug 2007 15:02:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxx

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>