From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MJ2Z6-0006SR-6K for qemu-devel@nongnu.org; Tue, 23 Jun 2009 05:45:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MJ2Z1-0006R7-L6 for qemu-devel@nongnu.org; Tue, 23 Jun 2009 05:45:19 -0400 Received: from [199.232.76.173] (port=55157 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MJ2Z1-0006R3-7B for qemu-devel@nongnu.org; Tue, 23 Jun 2009 05:45:15 -0400 Received: from mx2.redhat.com ([66.187.237.31]:54440) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MJ2Z0-0004oa-Go for qemu-devel@nongnu.org; Tue, 23 Jun 2009 05:45:14 -0400 Message-ID: <4A40A45E.8020906@redhat.com> Date: Tue, 23 Jun 2009 12:46:06 +0300 From: Avi Kivity MIME-Version: 1.0 References: <20090623012955.2d152759@doriath> In-Reply-To: <20090623012955.2d152759@doriath> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 10/11] QMP: Introduce basic events List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, ehabkost@redhat.com, jan.kiszka@siemens.com, dlaor@redhat.com, qemu-devel@nongnu.org On 06/23/2009 07:29 AM, Luiz Capitulino wrote: > Reboot, shutdown and powerdown are very basic events and can be > added together. > > Reboot only exists within a guest. qemu sees a reset (there are reboots not associated with a reset, for example kexec). > > diff --git a/vl.c b/vl.c > index 60a00e1..7dc5954 100644 > --- a/vl.c > +++ b/vl.c > @@ -3693,18 +3693,21 @@ void qemu_system_reset_request(void) > reset_requested = 1; > } > qemu_notify_event(); > + monitor_notify_event(EVENT_REBOOT); > } > > void qemu_system_shutdown_request(void) > { > shutdown_requested = 1; > qemu_notify_event(); > + monitor_notify_event(EVENT_SHUTDOWN); > } > > void qemu_system_powerdown_request(void) > { > powerdown_requested = 1; > qemu_notify_event(); > + monitor_notify_event(EVENT_POWERDOWN); > } > Maybe it's better to signal the event when the reset etc. actually takes place, to avoid subtle races. -- error compiling committee.c: too many arguments to function