qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp>
To: qemu-devel@nongnu.org
Subject: Re: [PATCH] Adds null check for DisplayStatus (wasRe: [Qemu-devel] [6344]	graphical_console_init change	(Stefano	Stabellini)
Date: Tue, 20 Jan 2009 00:26:09 +0900	[thread overview]
Message-ID: <49749B91.6080200@juno.dti.ne.jp> (raw)
In-Reply-To: <49746680.3070400@eu.citrix.com>

Stefano Stabellini wrote:
> Shin-ichiro KAWASAKI wrote:
> 
>> I'm sending the patch which solves the problem above.
>> Could anyone evaluate it?
>>
> 
> 
> 
> Thanks for spotting the bug and your work on a patch!
> 
> However I think the following fix is cleaner: we do not need a
> dumb_display_init that creates an empty DisplayChangeListener any more.
> We do need a dumb_display_init that allocates a zeroed DisplayState
> structure if none else does it.
> 
> Please let me know if it also fixes you problem.

It solves my problem finely.  Thank you!

Tested-by: Shin-ichiro KAWASAKI <kawasaki@juno.dti.ne.jp>

> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> 
> ---
> 
> diff --git a/vl.c b/vl.c
> index bfacdcf..63d954b 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2775,25 +2775,10 @@ DisplayState *get_displaystate(void)
>  
>  /* dumb display */
>  
> -static void dumb_update(DisplayState *ds, int x, int y, int w, int h)
> +static void dumb_display_init(void)
>  {
> -}
> -
> -static void dumb_resize(DisplayState *ds)
> -{
> -}
> -
> -static void dumb_display_init(DisplayState *ds)
> -{
> -    DisplayChangeListener *dcl = qemu_mallocz(sizeof(DisplayChangeListener));
> -    if (!dcl)
> -        exit(1);
> -    dcl->dpy_update = dumb_update;
> -    dcl->dpy_resize = dumb_resize;
> -    dcl->dpy_refresh = NULL;
> -    dcl->idle = 1;
> -    dcl->gui_timer_interval = 500;
> -    register_displaychangelistener(ds, dcl);
> +    DisplayState *ds = qemu_mallocz(sizeof(DisplayState));
> +    register_displaystate(ds);
>  }
>  
>  /***********************************************************/
> @@ -5535,6 +5520,8 @@ int main(int argc, char **argv, char **envp)
>          }
>      }
>  
> +    if (!display_state)
> +        dumb_display_init();
>      /* just use the first displaystate for the moment */
>      ds = display_state;
>      /* terminal init */
> @@ -5543,8 +5530,6 @@ int main(int argc, char **argv, char **envp)
>              fprintf(stderr, "fatal: -nographic can't be used with -curses\n");
>              exit(1);
>          }
> -        /* nearly nothing to do */
> -        dumb_display_init(ds);
>      } else { 
>  #if defined(CONFIG_CURSES)
>              if (curses) {
> @@ -5563,8 +5548,6 @@ int main(int argc, char **argv, char **envp)
>                      sdl_display_init(ds, full_screen, no_frame);
>  #elif defined(CONFIG_COCOA)
>                      cocoa_display_init(ds, full_screen);
> -#else
> -                    dumb_display_init(ds);
>  #endif
>              }
>      }
> 
> 
> 
> 
> 

  reply	other threads:[~2009-01-19 15:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16 19:04 [Qemu-devel] [6344] graphical_console_init change (Stefano Stabellini) Anthony Liguori
2009-01-18 12:54 ` Shin-ichiro KAWASAKI
2009-01-18 14:37   ` Aurelien Jarno
2009-01-18 14:48   ` [PATCH] Adds null check for DisplayStatus (wasRe: " Shin-ichiro KAWASAKI
2009-01-19 11:39     ` Stefano Stabellini
2009-01-19 15:26       ` Shin-ichiro KAWASAKI [this message]
2009-01-19 15:31         ` Stefano Stabellini
2009-01-19 16:08           ` Anthony Liguori
2009-01-19 16:19             ` Stefano Stabellini
2009-01-19 19:07               ` Anthony Liguori
2009-01-20 10:53                 ` [Qemu-devel] [PATCH] Adds null check for DisplayStatus Stefano Stabellini
2009-01-20 15:56                   ` Gerd Hoffmann
2009-01-20 16:36                     ` Stefano Stabellini
2009-01-21 11:06                   ` [Qemu-devel] " Stefano Stabellini
2009-01-21 18:59                   ` [Qemu-devel] " Anthony Liguori
2009-01-19 16:34       ` [PATCH] Adds null check for DisplayStatus (wasRe: [Qemu-devel] [6344] graphical_console_init change (Stefano Stabellini) Anthony Liguori
2009-02-09 11:38 ` Riku Voipio
2009-02-09 11:52   ` Stefano Stabellini
2009-02-09 17:00   ` Aurelien Jarno

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=49749B91.6080200@juno.dti.ne.jp \
    --to=kawasaki@juno.dti.ne.jp \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).