qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org, xen-devel@lists.xensource.com
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 2/2] xenner: use evtchn function pointers in the backends.
Date: Fri, 22 Aug 2008 12:25:28 +0200	[thread overview]
Message-ID: <1219400728-20422-3-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1219400728-20422-1-git-send-email-kraxel@redhat.com>

---
 hw/xen_backend.c |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/hw/xen_backend.c b/hw/xen_backend.c
index e926a01..fd07c03 100644
--- a/hw/xen_backend.c
+++ b/hw/xen_backend.c
@@ -39,6 +39,7 @@
 #include "hw.h"
 #include "qemu-char.h"
 #include "xen_backend.h"
+#include "xen_interfaces.h"
 
 /* ------------------------------------------------------------- */
 
@@ -200,19 +201,19 @@ static struct XenDevice *xen_be_get_xendev(char *type, int dom, int dev,
     xendev->debug      = debug;
     xendev->local_port = -1;
 
-    xendev->evtchndev = xc_evtchn_open();
+    xendev->evtchndev = xc_evtchn.open();
     if (xendev->evtchndev < 0) {
 	fprintf(stderr, "can't open evtchn device\n");
 	qemu_free(xendev);
 	return NULL;
     }
-    fcntl(xc_evtchn_fd(xendev->evtchndev), F_SETFD, FD_CLOEXEC);
+    fcntl(xc_evtchn.fd(xendev->evtchndev), F_SETFD, FD_CLOEXEC);
 
     if (ops->flags & DEVOPS_FLAG_NEED_GNTDEV) {
 	xendev->gnttabdev = xc_gnttab_open();
 	if (xendev->gnttabdev < 0) {
 	    fprintf(stderr, "can't open gnttab device\n");
-	    xc_evtchn_close(xendev->evtchndev);
+	    xc_evtchn.close(xendev->evtchndev);
 	    qemu_free(xendev);
 	    return NULL;
 	}
@@ -260,7 +261,7 @@ static struct XenDevice *xen_be_del_xendev(int dom, int dev)
 	}
 
 	if (xendev->evtchndev >= 0)
-	    xc_evtchn_close(xendev->evtchndev);
+	    xc_evtchn.close(xendev->evtchndev);
 	if (xendev->gnttabdev >= 0)
 	    xc_gnttab_close(xendev->gnttabdev);
 
@@ -595,13 +596,13 @@ static void xen_be_evtchn_event(void *opaque)
     struct XenDevice *xendev = opaque;
     evtchn_port_t port;
 
-    port = xc_evtchn_pending(xendev->evtchndev);
+    port = xc_evtchn.pending(xendev->evtchndev);
     if (port != xendev->local_port) {
-	xen_be_printf(xendev, 0, "xc_evtchn_pending returned %d (expected %d)\n",
+	xen_be_printf(xendev, 0, "xc_evtchn.pending returned %d (expected %d)\n",
 		      port, xendev->local_port);
 	return;
     }
-    xc_evtchn_unmask(xendev->evtchndev, port);
+    xc_evtchn.unmask(xendev->evtchndev, port);
 
     if (xendev->ops->event)
 	xendev->ops->event(xendev);
@@ -644,14 +645,14 @@ int xen_be_bind_evtchn(struct XenDevice *xendev)
 {
     if (xendev->local_port != -1)
 	return 0;
-    xendev->local_port = xc_evtchn_bind_interdomain
+    xendev->local_port = xc_evtchn.bind_interdomain
 	(xendev->evtchndev, xendev->dom, xendev->remote_port);
     if (-1 == xendev->local_port) {
-	xen_be_printf(xendev, 0, "xc_evtchn_bind_interdomain failed\n");
+	xen_be_printf(xendev, 0, "xc_evtchn.bind_interdomain failed\n");
 	return -1;
     }
     xen_be_printf(xendev, 2, "bind evtchn port %d\n", xendev->local_port);
-    qemu_set_fd_handler(xc_evtchn_fd(xendev->evtchndev),
+    qemu_set_fd_handler(xc_evtchn.fd(xendev->evtchndev),
 			xen_be_evtchn_event, NULL, xendev);
     return 0;
 }
@@ -660,15 +661,15 @@ void xen_be_unbind_evtchn(struct XenDevice *xendev)
 {
     if (xendev->local_port == -1)
 	return;
-    qemu_set_fd_handler(xc_evtchn_fd(xendev->evtchndev), NULL, NULL, NULL);
-    xc_evtchn_unbind(xendev->evtchndev, xendev->local_port);
+    qemu_set_fd_handler(xc_evtchn.fd(xendev->evtchndev), NULL, NULL, NULL);
+    xc_evtchn.unbind(xendev->evtchndev, xendev->local_port);
     xen_be_printf(xendev, 2, "unbind evtchn port %d\n", xendev->local_port);
     xendev->local_port = -1;
 }
 
 int xen_be_send_notify(struct XenDevice *xendev)
 {
-    return xc_evtchn_notify(xendev->evtchndev, xendev->local_port);
+    return xc_evtchn.notify(xendev->evtchndev, xendev->local_port);
 }
 
 /*
-- 
1.5.5.1

  parent reply	other threads:[~2008-08-22 10:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-22 10:25 [Qemu-devel] [PATCH 0/2] RfC: xenner (aka xen emulation) bits Gerd Hoffmann
2008-08-22 10:25 ` [Qemu-devel] [PATCH 1/2] xenner: add event channel implementation Gerd Hoffmann
2008-08-22 13:46   ` Anthony Liguori
2008-08-22 15:04     ` Gerd Hoffmann
2008-08-25 12:58       ` Gerd Hoffmann
2008-08-25 14:15         ` Anthony Liguori
2008-08-25 15:12           ` [Xen-devel] " Keir Fraser
2008-08-25 17:57             ` Anthony Liguori
2008-08-25 18:42               ` Keir Fraser
2008-08-26  8:27                 ` Gerd Hoffmann
2008-08-26  8:40                   ` Keir Fraser
2008-08-26  8:39                 ` Daniel P. Berrange
2008-08-22 10:25 ` Gerd Hoffmann [this message]
     [not found] ` <m2n.s.1KWU8S-002Pyj@chiark.greenend.org.uk>
2008-08-26 11:02   ` Ian Jackson
2008-08-26 13:13     ` Gerd Hoffmann
2008-08-26 13:28       ` Ian Jackson
2008-08-26 19:34         ` Gerd Hoffmann

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=1219400728-20422-3-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xen-devel@lists.xensource.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).