From patchwork Tue Jan 26 20:25:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 75233 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0QKPJPB019899 for ; Tue, 26 Jan 2010 20:25:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751248Ab0AZUZQ (ORCPT ); Tue, 26 Jan 2010 15:25:16 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751211Ab0AZUZQ (ORCPT ); Tue, 26 Jan 2010 15:25:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35472 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751120Ab0AZUZP (ORCPT ); Tue, 26 Jan 2010 15:25:15 -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 o0QKPEd2010011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 26 Jan 2010 15:25:14 -0500 Received: from doriath (vpn-11-184.rdu.redhat.com [10.11.11.184]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0QKPAil007928 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 26 Jan 2010 15:25:13 -0500 Date: Tue, 26 Jan 2010 18:25:08 -0200 From: Luiz Capitulino To: kvm@vger.kernel.org Cc: avi@redhat.com Subject: [PATCH] QMP: Emit Basic events Message-ID: <20100126182508.3c7186b6@doriath> Organization: Red Hat Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/qemu-kvm.c b/qemu-kvm.c index 1c34846..06706c9 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -17,6 +17,7 @@ #include "block.h" #include "compatfd.h" #include "gdbstub.h" +#include "monitor.h" #include "qemu-kvm.h" #include "libkvm.h" @@ -2124,11 +2125,14 @@ int kvm_main_loop(void) vm_stop(0); } else break; - } else if (qemu_powerdown_requested()) + } else if (qemu_powerdown_requested()) { + monitor_protocol_event(QEVENT_POWERDOWN, NULL); qemu_irq_raise(qemu_system_powerdown); - else if (qemu_reset_requested()) + } else if (qemu_reset_requested()) { + monitor_protocol_event(QEVENT_RESET, NULL); qemu_kvm_system_reset(); - else if (kvm_debug_cpu_requested) { + } else if (kvm_debug_cpu_requested) { + monitor_protocol_event(QEVENT_DEBUG, NULL); gdb_set_stop_cpu(kvm_debug_cpu_requested); vm_stop(EXCP_DEBUG); kvm_debug_cpu_requested = NULL;