All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>, Colin Lord <clord@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for 2.8 3/3] sdl: Modularize
Date: Mon, 1 Aug 2016 11:39:19 +0100	[thread overview]
Message-ID: <20160801103919.GI6455@redhat.com> (raw)
In-Reply-To: <1469600777-30413-4-git-send-email-famz@redhat.com>

On Wed, Jul 27, 2016 at 02:26:17PM +0800, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  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 :|

  parent reply	other threads:[~2016-08-01 10:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-27  6:26 [Qemu-devel] [PATCH for 2.8 0/3] Modularize SDL Fam Zheng
2016-07-27  6:26 ` [Qemu-devel] [PATCH for 2.8 1/3] rules.mak: Don't extract libs from .mo-libs in link command Fam Zheng
2016-08-01 10:24   ` Paolo Bonzini
2016-07-27  6:26 ` [Qemu-devel] [PATCH for 2.8 2/3] configure: Add CONFIG_SDL2 Fam Zheng
2016-07-27  6:26 ` [Qemu-devel] [PATCH for 2.8 3/3] sdl: Modularize Fam Zheng
2016-07-27 23:23   ` Colin Lord
2016-07-28  5:17     ` Fam Zheng
2016-07-28  7:43       ` Fam Zheng
2016-08-01 10:33       ` Paolo Bonzini
2016-08-01 10:31   ` Paolo Bonzini
2016-08-02  1:28     ` Fam Zheng
2016-08-01 10:39   ` Daniel P. Berrange [this message]
2016-08-01 11:53   ` Gerd Hoffmann
2016-08-02  1:22     ` Fam Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160801103919.GI6455@redhat.com \
    --to=berrange@redhat.com \
    --cc=clord@redhat.com \
    --cc=famz@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.