From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0tNG-00045f-PL for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:17:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0tNF-0000LL-0w for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:17:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0tNE-0000Ke-Ow for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:17:32 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 6923C2DC41E for ; Fri, 5 Jun 2015 15:17:32 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-29.ams2.redhat.com [10.36.112.29]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t55FG4l1012808 for ; Fri, 5 Jun 2015 11:17:31 -0400 From: Paolo Bonzini Date: Fri, 5 Jun 2015 17:15:50 +0200 Message-Id: <1433517363-32335-50-git-send-email-pbonzini@redhat.com> In-Reply-To: <1433517363-32335-1-git-send-email-pbonzini@redhat.com> References: <1433517363-32335-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 49/62] vl: run "late" notifiers immediately List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org If a machine_init_done notifier is added late, as part of a hot-plugged device, run it immediately. Signed-off-by: Paolo Bonzini --- vl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vl.c b/vl.c index df5a727..66ccd06 100644 --- a/vl.c +++ b/vl.c @@ -2500,14 +2500,20 @@ static void qemu_run_exit_notifiers(void) notifier_list_notify(&exit_notifiers, NULL); } +static bool machine_init_done; + void qemu_add_machine_init_done_notifier(Notifier *notify) { notifier_list_add(&machine_init_done_notifiers, notify); + if (machine_init_done) { + notify->notify(notify, NULL); + } } static void qemu_run_machine_init_done_notifiers(void) { notifier_list_notify(&machine_init_done_notifiers, NULL); + machine_init_done = true; } static const QEMUOption *lookup_opt(int argc, char **argv, -- 2.4.1