[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for 2.8 3/3] sdl: Modularize
From: |
Daniel P. Berrange |
Subject: |
Re: [Qemu-devel] [PATCH for 2.8 3/3] sdl: Modularize |
Date: |
Mon, 1 Aug 2016 11:39:19 +0100 |
User-agent: |
Mutt/1.6.2 (2016-07-01) |
On Wed, Jul 27, 2016 at 02:26:17PM +0800, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <address@hidden>
> ---
> 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 :|