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] [PATCH] qemu-xen: update for libxc evtchn interface change.

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] qemu-xen: update for libxc evtchn interface change.
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Fri, 3 Dec 2010 09:57:55 +0000
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Fri, 03 Dec 2010 02:33:44 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1291370224@xxxxxxxxxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1291370224@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 hw/xen_backend.c  |    6 +++---
 hw/xen_backend.h  |    2 +-
 i386-dm/helper2.c |    8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/hw/xen_backend.c b/hw/xen_backend.c
index 537e21f..577f68e 100644
--- a/hw/xen_backend.c
+++ b/hw/xen_backend.c
@@ -208,8 +208,8 @@ static struct XenDevice *xen_be_get_xendev(const char 
*type, int dom, int dev,
     xendev->debug      = debug;
     xendev->local_port = -1;
 
-    xendev->evtchndev = xc_evtchn_open();
-    if (xendev->evtchndev < 0) {
+    xendev->evtchndev = xc_evtchn_open(NULL, 0);
+    if (xendev->evtchndev == NULL) {
        xen_be_printf(NULL, 0, "can't open evtchn device\n");
        qemu_free(xendev);
        return NULL;
@@ -267,7 +267,7 @@ static struct XenDevice *xen_be_del_xendev(int dom, int dev)
            qemu_free(xendev->fe);
        }
 
-       if (xendev->evtchndev >= 0)
+       if (xendev->evtchndev != NULL)
            xc_evtchn_close(xendev->evtchndev);
        if (xendev->gnttabdev >= 0)
            xc_gnttab_close(xc_handle, xendev->gnttabdev);
diff --git a/hw/xen_backend.h b/hw/xen_backend.h
index 28e77ac..a68067d 100644
--- a/hw/xen_backend.h
+++ b/hw/xen_backend.h
@@ -44,7 +44,7 @@ struct XenDevice {
     int                remote_port;
     int                local_port;
 
-    int                evtchndev;
+    xc_evtchn          *evtchndev;
     int                gnttabdev;
 
     struct XenDevOps   *ops;
diff --git a/i386-dm/helper2.c b/i386-dm/helper2.c
index ce73421..4993f1e 100644
--- a/i386-dm/helper2.c
+++ b/i386-dm/helper2.c
@@ -104,7 +104,7 @@ buffered_iopage_t *buffered_io_page = NULL;
 QEMUTimer *buffered_io_timer;
 
 /* the evtchn fd for polling */
-int xce_handle = -1;
+xc_interface *xce_handle = NULL;
 
 /* which vcpu we are serving */
 int send_vcpu = 0;
@@ -138,8 +138,8 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
 
         cpu_single_env = env;
 
-        xce_handle = xc_evtchn_open();
-        if (xce_handle == -1) {
+        xce_handle = xc_evtchn_open(NULL, 0);
+        if (xce_handle == NULL) {
             perror("open");
             return NULL;
         }
@@ -553,7 +553,7 @@ int xen_pause_requested;
 int main_loop(void)
 {
     CPUState *env = cpu_single_env;
-    int evtchn_fd = xce_handle == -1 ? -1 : xc_evtchn_fd(xce_handle);
+    int evtchn_fd = xce_handle == NULL ? -1 : xc_evtchn_fd(xce_handle);
     char *qemu_file;
     fd_set fds;
 
-- 
1.5.6.5


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