From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9MoG-0000BY-US for qemu-devel@nongnu.org; Wed, 05 Sep 2012 17:06:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9MoE-0001jj-Vt for qemu-devel@nongnu.org; Wed, 05 Sep 2012 17:06:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50339) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9MoE-0001jZ-MU for qemu-devel@nongnu.org; Wed, 05 Sep 2012 17:06:50 -0400 From: Igor Mammedov Date: Wed, 5 Sep 2012 23:06:25 +0200 Message-Id: <1346879185-19299-6-git-send-email-imammedo@redhat.com> In-Reply-To: <1346879185-19299-1-git-send-email-imammedo@redhat.com> References: <1346879185-19299-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH 5/5] Cleanup unused global var qemu_system_powerdown List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org, qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, mst@redhat.com, jan.kiszka@siemens.com, lcapitulino@redhat.com, blauwirbel@gmail.com, alex.williamson@redhat.com, kraxel@redhat.com, pbonzini@redhat.com All deps that used global qemu_system_powerdown var are now converted to notifiers, so remove it. Signed-off-by: Igor Mammedov --- v2: - removed hunk with #include "hw/irq.h", for patch not to depend on cpu_as_device series. - reuse name of removed qemu_system_powerdown var as a function name for initiating system powerdown, by uninling monitor and notifiers call in it at the last commit to fix bisectability of series. Suggested-by: Paolo Bonzini --- sysemu.h | 1 - vl.c | 12 +++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sysemu.h b/sysemu.h index 803c858..1093046 100644 --- a/sysemu.h +++ b/sysemu.h @@ -62,7 +62,6 @@ int qemu_reset_requested(void); int qemu_powerdown_requested(void); void qemu_system_killed(int signal, pid_t pid); void qemu_kill_report(void); -extern qemu_irq qemu_system_powerdown; void qemu_devices_reset(void); void qemu_system_reset(bool report); diff --git a/vl.c b/vl.c index 4893192..e0d1295 100644 --- a/vl.c +++ b/vl.c @@ -1565,6 +1565,12 @@ void qemu_system_shutdown_request(void) qemu_notify_event(); } +static void qemu_system_powerdown(void) +{ + monitor_protocol_event(QEVENT_POWERDOWN, NULL); + notifier_list_notify(&powerdown_notifiers, NULL); +} + void qemu_system_powerdown_request(void) { powerdown_requested = 1; @@ -1588,8 +1594,6 @@ void qemu_system_vmstop_request(RunState state) qemu_notify_event(); } -qemu_irq qemu_system_powerdown; - static bool main_loop_should_exit(void) { RunState r; @@ -1626,9 +1630,7 @@ static bool main_loop_should_exit(void) monitor_protocol_event(QEVENT_WAKEUP, NULL); } if (qemu_powerdown_requested()) { - monitor_protocol_event(QEVENT_POWERDOWN, NULL); - notifier_list_notify(&powerdown_notifiers, NULL); - qemu_irq_raise(qemu_system_powerdown); + qemu_system_powerdown(); } if (qemu_vmstop_requested(&r)) { vm_stop(r); -- 1.7.11.4