From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: [PATCH] qemu-xen: fix unmapping logic in hw/xen_console.c Date: Wed, 08 Jun 2011 17:44:08 +0800 Message-ID: <1307526248.31359.28.camel@limbo> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" Cc: Ian Jackson List-Id: xen-devel@lists.xenproject.org This is a patch for qemu-xen. Don't know if it is the right place to post. It has been fixed in upstream QEMU. ------8<---------------- commit 28ec10ef3ff22873cd3f1b703d3aecbc93cbf680 Author: Wei Liu Date: Wed Jun 8 17:40:02 2011 +0800 qemu-xen: fix unmapping logic in hw/xen_console.c. Signed-off-by: Wei Liu diff --git a/hw/xen_console.c b/hw/xen_console.c index 0a2374c..d7099c4 100644 --- a/hw/xen_console.c +++ b/hw/xen_console.c @@ -258,7 +258,7 @@ static void con_disconnect(struct XenDevice *xendev) xen_be_unbind_evtchn(&con->xendev); if (con->sring) { - if (!xendev->dev) + if (!xendev->gnttabdev) munmap(con->sring, XC_PAGE_SIZE); else xc_gnttab_munmap(xendev->gnttabdev, con->sring, 1);