diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2010-12-23 15:25:57 +0000 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2010-12-23 15:25:57 +0000 |
commit | 3e446a35ee82c738367e8f90e3bc9166687043a8 (patch) | |
tree | d2ed5fd210a798cb5c54007a08e8bd2b9e9a221f /tools/xentrace | |
parent | 252cb308e37470915d0f64c730e4e2e829ec2512 (diff) | |
download | xen-3e446a35ee82c738367e8f90e3bc9166687043a8.tar.gz xen-3e446a35ee82c738367e8f90e3bc9166687043a8.tar.bz2 xen-3e446a35ee82c738367e8f90e3bc9166687043a8.zip |
libxc: convert evtchn interfaces to use an opaque handle type
This makes the interface consistent with the changes made to the main
interface in 21483:779c0ef9682c.
Also fix some references to "struct xc_interface" which should have
been simply "xc_interface" in tools/xenpaging, and update QEMU_TAG to
pull in the corresponding qemu change.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/xentrace')
-rw-r--r-- | tools/xentrace/xentrace.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tools/xentrace/xentrace.c b/tools/xentrace/xentrace.c index 9e07f3f2c4..e380531e35 100644 --- a/tools/xentrace/xentrace.c +++ b/tools/xentrace/xentrace.c @@ -73,7 +73,7 @@ settings_t opts; int interrupted = 0; /* gets set if we get a SIGHUP */ static xc_interface *xc_handle; -static int event_fd = -1; +static xc_evtchn *xce_handle = NULL; static int virq_port = -1; static int outfd = 1; @@ -576,14 +576,13 @@ static void event_init(void) { int rc; - rc = xc_evtchn_open(); - if (rc < 0) { + xce_handle = xc_evtchn_open(NULL, 0); + if (xce_handle == NULL) { perror("event channel open"); exit(EXIT_FAILURE); } - event_fd = rc; - rc = xc_evtchn_bind_virq(event_fd, VIRQ_TBUF); + rc = xc_evtchn_bind_virq(xce_handle, VIRQ_TBUF); if (rc == -1) { PERROR("failed to bind to VIRQ port"); exit(EXIT_FAILURE); @@ -598,7 +597,7 @@ static void event_init(void) static void wait_for_event_or_timeout(unsigned long milliseconds) { int rc; - struct pollfd fd = { .fd = event_fd, + struct pollfd fd = { .fd = xc_evtchn_fd(xce_handle), .events = POLLIN | POLLERR }; int port; @@ -611,7 +610,7 @@ static void wait_for_event_or_timeout(unsigned long milliseconds) } if (rc == 1) { - port = xc_evtchn_pending(event_fd); + port = xc_evtchn_pending(xce_handle); if (port == -1) { PERROR("failed to read port from evtchn"); exit(EXIT_FAILURE); @@ -622,7 +621,7 @@ static void wait_for_event_or_timeout(unsigned long milliseconds) port, virq_port); exit(EXIT_FAILURE); } - rc = xc_evtchn_unmask(event_fd, port); + rc = xc_evtchn_unmask(xce_handle, port); if (rc == -1) { PERROR("failed to write port to evtchn"); exit(EXIT_FAILURE); |