From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50097) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQ0Qr-0001oP-Vb for qemu-devel@nongnu.org; Mon, 04 Jun 2018 21:06:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQ0Qo-00014F-0k for qemu-devel@nongnu.org; Mon, 04 Jun 2018 21:06:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41126) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fQ0Qn-00013n-R2 for qemu-devel@nongnu.org; Mon, 04 Jun 2018 21:06:37 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1F6D765F5A for ; Tue, 5 Jun 2018 01:06:37 +0000 (UTC) Date: Mon, 4 Jun 2018 22:06:35 -0300 From: Eduardo Habkost Message-ID: <20180605010635.GG3184@localhost.localdomain> References: <20180604120345.12955-1-berrange@redhat.com> <20180604120345.12955-3-berrange@redhat.com> <20180604170111.33480718@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180604170111.33480718@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 2/2] vl: fix use of --daemonize with --preconfig List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: Michal Privoznik , Markus Armbruster , qemu-devel@nongnu.org, Max Reitz , Paolo Bonzini On Mon, Jun 04, 2018 at 05:01:11PM +0200, Igor Mammedov wrote: [...] > I'd prefer your patch, as it doesn't break error handling, > or maybe even shorter version which keeps state transitions in one place: > > diff --git a/vl.c b/vl.c > index c4fe255..fa44138 100644 > --- a/vl.c > +++ b/vl.c > @@ -1956,7 +1956,7 @@ static void main_loop(void) > #ifdef CONFIG_PROFILER > int64_t ti; > #endif > - do { > + while (!main_loop_should_exit()) { > #ifdef CONFIG_PROFILER > ti = profile_getclock(); > #endif > @@ -1964,7 +1964,7 @@ static void main_loop(void) > #ifdef CONFIG_PROFILER > dev_time += profile_getclock() - ti; > #endif > - } while (!main_loop_should_exit()); > + } > } Would this also fix the bug mentioned at: "vl.c: make default main_loop_wait() timeout independed of slirp"? -- Eduardo