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] Fix abusive use of xce_handle as FD

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Fix abusive use of xce_handle as FD
From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Date: Tue, 26 Feb 2008 13:11:02 +0000
Delivery-date: Tue, 26 Feb 2008 05:12:11 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
xce handles are not supposed to be used as file descriptors, but
xc_evtchn_fd() be used.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>

diff -r 00588ab75f22 tools/ioemu/hw/xen_console.c
--- a/tools/ioemu/hw/xen_console.c      Tue Feb 26 13:07:06 2008 +0000
+++ b/tools/ioemu/hw/xen_console.c      Tue Feb 26 13:07:09 2008 +0000
@@ -381,7 +381,7 @@ static void xencons_startup(void *opaque
        qemu_set_fd_handler2(xs_fileno(dom->xsh), NULL, NULL, NULL, NULL);
 
        fprintf(stderr, "Console: connected to guest frontend\n");
-       if (qemu_set_fd_handler2(dom->xce_handle, NULL, xencons_ring_read, 
NULL, dom) < 0)
+       if (qemu_set_fd_handler2(xc_evtchn_fd(dom->xce_handle), NULL, 
xencons_ring_read, NULL, dom) < 0)
                return;
 
        qemu_chr_add_handlers(dom->chr, xencons_can_receive, xencons_receive,
diff -r 00588ab75f22 tools/ioemu/hw/xenfb.c
--- a/tools/ioemu/hw/xenfb.c    Tue Feb 26 13:07:06 2008 +0000
+++ b/tools/ioemu/hw/xenfb.c    Tue Feb 26 13:07:09 2008 +0000
@@ -1166,7 +1166,7 @@ static int xenfb_register_console(struct
                             xenfb);
        dpy_resize(xenfb->ds, xenfb->width, xenfb->height);
 
-       if (qemu_set_fd_handler2(xenfb->evt_xch, NULL, xenfb_dispatch_channel, 
NULL, xenfb) < 0)
+       if (qemu_set_fd_handler2(xc_evtchn_fd(xenfb->evt_xch), NULL, 
xenfb_dispatch_channel, NULL, xenfb) < 0)
                return -1;
        if (qemu_set_fd_handler2(xs_fileno(xenfb->xsh), NULL, 
xenfb_dispatch_store, NULL, xenfb) < 0)
                return -1;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Fix abusive use of xce_handle as FD, Samuel Thibault <=