From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0Q7V-0003v3-NU for qemu-devel@nongnu.org; Thu, 04 Jun 2015 04:03:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0Q7S-00006t-Ir for qemu-devel@nongnu.org; Thu, 04 Jun 2015 04:03:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0Q7S-00006j-E5 for qemu-devel@nongnu.org; Thu, 04 Jun 2015 04:03:18 -0400 Message-ID: <55700642.9070900@redhat.com> Date: Thu, 04 Jun 2015 10:03:14 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1433351328-23326-1-git-send-email-pbonzini@redhat.com> <1433351328-23326-13-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 12/23] vl: run "late" notifiers immediately List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: "Michael S. Tsirkin" , Laszlo Ersek , "qemu-devel@nongnu.org Developers" , Gerd Hoffmann On 04/06/2015 08:39, Peter Crosthwaite wrote: > On Wed, Jun 3, 2015 at 10:08 AM, Paolo Bonzini wrote: >> If a machine_init_done notifier is added late, as part of a hot-plugged >> device, run it immediately. > > Blank line? Yes, thanks. Paolo >> Signed-off-by: Paolo Bonzini > > Reviewed-by: Peter Crosthwaite > >> --- >> vl.c | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/vl.c b/vl.c >> index 0707cfa..00def69 100644 >> --- a/vl.c >> +++ b/vl.c >> @@ -2498,14 +2498,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 >> >> >>