From: Vincent Bernardoff <vb@luminar.eu.org>
To: xen-devel@lists.xen.org
Subject: libxc/evtchn: Missed events when using several handles.
Date: Tue, 06 Aug 2013 11:15:13 +0100 [thread overview]
Message-ID: <5200CCB1.6080003@luminar.eu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 265 bytes --]
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
[-- Attachment #2: test_evtchn.c --]
[-- Type: text/x-csrc, Size: 1242 bytes --]
#include <stdio.h>
#include <stdlib.h>
#include <sys/select.h>
#include <xenctrl.h>
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);
}
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next reply other threads:[~2013-08-06 10:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-06 10:15 Vincent Bernardoff [this message]
2013-08-06 10:29 ` libxc/evtchn: Missed events when using several handles Ian Campbell
2013-08-06 10:48 ` Vincent Bernardoff
2013-08-06 11:03 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5200CCB1.6080003@luminar.eu.org \
--to=vb@luminar.eu.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.