From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUAd6-0005Rs-CU for qemu-devel@nongnu.org; Mon, 01 Aug 2016 06:39:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUAd1-0000fE-KC for qemu-devel@nongnu.org; Mon, 01 Aug 2016 06:39:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38606) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUAd1-0000f9-EK for qemu-devel@nongnu.org; Mon, 01 Aug 2016 06:39:23 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0CCDA61E46 for ; Mon, 1 Aug 2016 10:39:23 +0000 (UTC) Date: Mon, 1 Aug 2016 11:39:19 +0100 From: "Daniel P. Berrange" Message-ID: <20160801103919.GI6455@redhat.com> Reply-To: "Daniel P. Berrange" References: <1469600777-30413-1-git-send-email-famz@redhat.com> <1469600777-30413-4-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1469600777-30413-4-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH for 2.8 3/3] sdl: Modularize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu-devel@nongnu.org, Paolo Bonzini , Gerd Hoffmann , Colin Lord On Wed, Jul 27, 2016 at 02:26:17PM +0800, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > Makefile.objs | 1 + > configure | 4 +-- > include/qemu/module.h | 2 ++ > include/ui/console.h | 5 ++-- > ui/Makefile.objs | 2 ++ > ui/sdl-init.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++ > ui/sdl.c | 19 ++++++------- > ui/sdl2.c | 26 ++++++------------ > util/module.c | 6 +++++ > vl.c | 5 +++- > 10 files changed, 111 insertions(+), 34 deletions(-) > create mode 100644 ui/sdl-init.c [snip] > diff --git a/vl.c b/vl.c > index a455947..fdbbe47 100644 > --- a/vl.c > +++ b/vl.c > @@ -4221,7 +4221,10 @@ int main(int argc, char **argv, char **envp) > } > > if (display_type == DT_SDL) { > - sdl_display_early_init(request_opengl); > + if (!sdl_display_early_init(request_opengl)) { > + error_report("Failed to initialize SDL"); > + exit(1); > + } > } SDL has some nasty stuff where it tries to replace main() with a call to SDL_main on certain platforms. Merely #include'ing SDL.h in vl.c causes this to happen on Win32 at least, perhaps other platforms too. I'm unclear if your modularization here will apply to all platforms or just Linux - g_module at least can work on Win32. Anyway, to fully support modularization without nasty surprises, we probably want to stop this main() replacement. I sent a patch for that last year https://lists.nongnu.org/archive/html/qemu-devel/2015-08/msg01631.html Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|