Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LrYaJ-0006uz-2p for qemu-devel@nongnu.org; Wed, 08 Apr 2009 10:16:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LrYaE-0006tJ-HI for qemu-devel@nongnu.org; Wed, 08 Apr 2009 10:16:58 -0400 Received: from [199.232.76.173] (port=42913 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LrYaE-0006tG-DH for qemu-devel@nongnu.org; Wed, 08 Apr 2009 10:16:54 -0400 Received: from e8.ny.us.ibm.com ([32.97.182.138]:48393) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LrYaE-0004it-2r for qemu-devel@nongnu.org; Wed, 08 Apr 2009 10:16:54 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e8.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n38E8Dh3010037 for ; Wed, 8 Apr 2009 10:08:13 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n38EGrUM182506 for ; Wed, 8 Apr 2009 10:16:53 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n38EGqv0014979 for ; Wed, 8 Apr 2009 10:16:52 -0400 From: Anthony Liguori Date: Wed, 8 Apr 2009 09:16:44 -0500 Message-Id: <1239200204-4934-3-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1239200204-4934-1-git-send-email-aliguori@us.ibm.com> References: <1239200204-4934-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 3/3] Implement vm-state notifications Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: libvir-list@redhat.com, Anthony Liguori , Jan Kiszka , Hollis Blanchard This patch adds notification whenever a vm starts or stops. Signed-off-by: Anthony Liguori diff --git a/vl.c b/vl.c index f78cabb..ca0bcf9 100644 --- a/vl.c +++ b/vl.c @@ -164,6 +164,8 @@ int main(int argc, char **argv) #include "libslirp.h" #endif +#include "wait.h" + //#define DEBUG_UNUSED_IOPORT //#define DEBUG_IOPORT //#define DEBUG_NET @@ -3545,6 +3547,11 @@ static void vm_state_notify(int running, int reason) { VMChangeStateEntry *e; + if (running) + qemu_notify_event("vm-state", "start", ""); + else + qemu_notify_event("vm-state", "stop", ""); + for (e = vm_change_state_head.lh_first; e; e = e->entries.le_next) { e->cb(e->opaque, running, reason); }