From patchwork Mon Dec 21 08:09:21 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 41529 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2B629B6F0C for ; Mon, 21 Dec 2009 19:54:20 +1100 (EST) Received: from localhost ([127.0.0.1]:45920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMe1x-00070H-BA for incoming@patchwork.ozlabs.org; Mon, 21 Dec 2009 03:54:17 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NMdKw-0002mN-J4 for qemu-devel@nongnu.org; Mon, 21 Dec 2009 03:09:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NMdKp-0002iR-IC for qemu-devel@nongnu.org; Mon, 21 Dec 2009 03:09:48 -0500 Received: from [199.232.76.173] (port=52819 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMdKo-0002i8-So for qemu-devel@nongnu.org; Mon, 21 Dec 2009 03:09:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:9183) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NMdKo-0003oe-AU for qemu-devel@nongnu.org; Mon, 21 Dec 2009 03:09:42 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBL89fre020491 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 21 Dec 2009 03:09:41 -0500 Received: from localhost.localdomain (vpn2-10-119.ams2.redhat.com [10.36.10.119]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBL89V3U011460 for ; Mon, 21 Dec 2009 03:09:41 -0500 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 21 Dec 2009 09:09:21 +0100 Message-Id: <1261382970-23251-11-git-send-email-pbonzini@redhat.com> In-Reply-To: <1261382970-23251-1-git-send-email-pbonzini@redhat.com> References: <1261382970-23251-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 10/19] add qemu_bh_scheduled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Paolo Bonzini --- async.c | 5 +++++ qemu-common.h | 2 ++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/async.c b/async.c index 57ac3a8..d58a1d5 100644 --- a/async.c +++ b/async.c @@ -188,6 +188,11 @@ void qemu_bh_cancel(QEMUBH *bh) bh->scheduled = 0; } +bool qemu_bh_scheduled(QEMUBH *bh) +{ + return bh->scheduled && !bh->deleted; +} + void qemu_bh_delete(QEMUBH *bh) { bh->scheduled = 0; diff --git a/qemu-common.h b/qemu-common.h index 8630f8c..fac6a18 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -16,6 +16,7 @@ /* we put basic includes here to avoid repeating them in device drivers */ #include +#include #include #include #include @@ -106,6 +107,7 @@ void qemu_bh_schedule(QEMUBH *bh); * iteration. */ void qemu_bh_schedule_idle(QEMUBH *bh); +bool qemu_bh_scheduled(QEMUBH *bh); void qemu_bh_cancel(QEMUBH *bh); void qemu_bh_delete(QEMUBH *bh); int qemu_bh_poll(void);