From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vincent Bernardoff Subject: libxc/evtchn: Missed events when using several handles. Date: Tue, 06 Aug 2013 11:15:13 +0100 Message-ID: <5200CCB1.6080003@luminar.eu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000100010009090703020802" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------000100010009090703020802 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Using the attached test programs, the select fails when using h2, and works with using h1 (line 41). It seems that using several evtchn handles does not work correctly. What is the expected behaviour when using multiple event channel handles ? Cheers, Vincent --------------000100010009090703020802 Content-Type: text/x-csrc; name="test_evtchn.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="test_evtchn.c" #include #include #include #include int main(int argc, char** argv) { // This test is to check that you can use several handles to evtchn. xc_evtchn *h1, *h2; evtchn_port_or_error_t dest, src; int fd, ret; fd_set fdset; FD_ZERO(&fdset); h1 = xc_evtchn_open(NULL, 0); h2 = xc_evtchn_open(NULL, 0); if (h1 == NULL || h2 == NULL) { perror("xc_evtchn_open"); exit(EXIT_FAILURE); } dest = xc_evtchn_bind_unbound_port(h1, 0); if (dest == -1) { perror("xc_evtchn_bind_unbound_port"); exit(EXIT_FAILURE); } src = xc_evtchn_bind_interdomain(h1, 0, dest); if (src == -1) { perror("xc_evtchn_bind_interdomain"); exit(EXIT_FAILURE); } fd = xc_evtchn_fd(h2); if (fd < 0) { perror("xc_evtchn_fd"); exit(EXIT_FAILURE); } FD_SET(fd, &fdset); ret = xc_evtchn_notify(h1, src); if (ret == -1) { perror("xc_evtchn_notify"); exit(EXIT_FAILURE); } ret = select(fd+1, &fdset, NULL, NULL, NULL); if (ret == -1) { perror("select"); exit(EXIT_FAILURE); } printf("select says there is %d bit set in the bitmask.\n", ret); exit(EXIT_SUCCESS); } --------------000100010009090703020802 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --------------000100010009090703020802--