qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] console: Don't expose the the ui module's functions when the module is not available.
@ 2011-07-26  2:24 TeLeMan
  2011-07-26  2:32 ` Anthony Liguori
  0 siblings, 1 reply; 3+ messages in thread
From: TeLeMan @ 2011-07-26  2:24 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-trivial, TeLeMan, qemu-devel

If there is no sdl support, the implement of sdl_display_init() is missing and its declaration should not be exposed.
vnc, cocoa, curses and other ui modules are the same as sdl.

Signed-off-by: TeLeMan <geleman@gmail.com>
---
 console.h |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/console.h b/console.h
index 67d1373..ede8bea 100644
--- a/console.h
+++ b/console.h
@@ -363,19 +363,24 @@ void qemu_console_copy(DisplayState *ds, int src_x, int src_y,
                        int dst_x, int dst_y, int w, int h);
 
 /* sdl.c */
+#ifdef CONFIG_SDL
 void sdl_display_init(DisplayState *ds, int full_screen, int no_frame);
+#endif
 
 /* cocoa.m */
+#ifdef CONFIG_COCOA
 void cocoa_display_init(DisplayState *ds, int full_screen);
+#endif
 
 /* vnc.c */
+#ifdef CONFIG_VNC
 void vnc_display_init(DisplayState *ds);
 void vnc_display_close(DisplayState *ds);
 int vnc_display_open(DisplayState *ds, const char *display);
 void vnc_display_add_client(DisplayState *ds, int csock, int skipauth);
 int vnc_display_disable_login(DisplayState *ds);
 char *vnc_display_local_addr(DisplayState *ds);
-#ifdef CONFIG_VNC
+
 int vnc_display_password(DisplayState *ds, const char *password);
 int vnc_display_pw_expire(DisplayState *ds, time_t expires);
 void do_info_vnc_print(Monitor *mon, const QObject *data);
@@ -401,6 +406,8 @@ static inline void do_info_vnc_print(Monitor *mon, const QObject *data)
 #endif
 
 /* curses.c */
+#ifdef CONFIG_CURSES
 void curses_display_init(DisplayState *ds, int full_screen);
+#endif
 
 #endif
-- 
1.7.3.1.msysgit.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] console: Don't expose the the ui module's functions when the module is not available.
  2011-07-26  2:24 [Qemu-devel] [PATCH] console: Don't expose the the ui module's functions when the module is not available TeLeMan
@ 2011-07-26  2:32 ` Anthony Liguori
  2011-07-26  2:56   ` TeLeMan
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony Liguori @ 2011-07-26  2:32 UTC (permalink / raw)
  To: TeLeMan; +Cc: qemu-trivial, qemu-devel

On 07/25/2011 09:24 PM, TeLeMan wrote:
> If there is no sdl support, the implement of sdl_display_init() is missing and its declaration should not be exposed.
> vnc, cocoa, curses and other ui modules are the same as sdl.
>
> Signed-off-by: TeLeMan<geleman@gmail.com>

Nack.

There's no harm in exposing these and it avoids cluttered #ifdefs.

Regards,

Anthony Liguori

> ---
>   console.h |    9 ++++++++-
>   1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/console.h b/console.h
> index 67d1373..ede8bea 100644
> --- a/console.h
> +++ b/console.h
> @@ -363,19 +363,24 @@ void qemu_console_copy(DisplayState *ds, int src_x, int src_y,
>                          int dst_x, int dst_y, int w, int h);
>
>   /* sdl.c */
> +#ifdef CONFIG_SDL
>   void sdl_display_init(DisplayState *ds, int full_screen, int no_frame);
> +#endif
>
>   /* cocoa.m */
> +#ifdef CONFIG_COCOA
>   void cocoa_display_init(DisplayState *ds, int full_screen);
> +#endif
>
>   /* vnc.c */
> +#ifdef CONFIG_VNC
>   void vnc_display_init(DisplayState *ds);
>   void vnc_display_close(DisplayState *ds);
>   int vnc_display_open(DisplayState *ds, const char *display);
>   void vnc_display_add_client(DisplayState *ds, int csock, int skipauth);
>   int vnc_display_disable_login(DisplayState *ds);
>   char *vnc_display_local_addr(DisplayState *ds);
> -#ifdef CONFIG_VNC
> +
>   int vnc_display_password(DisplayState *ds, const char *password);
>   int vnc_display_pw_expire(DisplayState *ds, time_t expires);
>   void do_info_vnc_print(Monitor *mon, const QObject *data);
> @@ -401,6 +406,8 @@ static inline void do_info_vnc_print(Monitor *mon, const QObject *data)
>   #endif
>
>   /* curses.c */
> +#ifdef CONFIG_CURSES
>   void curses_display_init(DisplayState *ds, int full_screen);
> +#endif
>
>   #endif

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] console: Don't expose the the ui module's functions when the module is not available.
  2011-07-26  2:32 ` Anthony Liguori
@ 2011-07-26  2:56   ` TeLeMan
  0 siblings, 0 replies; 3+ messages in thread
From: TeLeMan @ 2011-07-26  2:56 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-trivial, qemu-devel

On Tue, Jul 26, 2011 at 10:32, Anthony Liguori <aliguori@us.ibm.com> wrote:
> On 07/25/2011 09:24 PM, TeLeMan wrote:
>>
>> If there is no sdl support, the implement of sdl_display_init() is missing
>> and its declaration should not be exposed.
>> vnc, cocoa, curses and other ui modules are the same as sdl.
>>
>> Signed-off-by: TeLeMan<geleman@gmail.com>
>
> Nack.
>
> There's no harm in exposing these and it avoids cluttered #ifdefs.
This patch can avoid breakage on link stage . See my another patch:
http://lists.nongnu.org/archive/html/qemu-devel/2011-07/msg02616.html


> Regards,
>
> Anthony Liguori
>
>> ---
>>  console.h |    9 ++++++++-
>>  1 files changed, 8 insertions(+), 1 deletions(-)
>>
>> diff --git a/console.h b/console.h
>> index 67d1373..ede8bea 100644
>> --- a/console.h
>> +++ b/console.h
>> @@ -363,19 +363,24 @@ void qemu_console_copy(DisplayState *ds, int src_x,
>> int src_y,
>>                         int dst_x, int dst_y, int w, int h);
>>
>>  /* sdl.c */
>> +#ifdef CONFIG_SDL
>>  void sdl_display_init(DisplayState *ds, int full_screen, int no_frame);
>> +#endif
>>
>>  /* cocoa.m */
>> +#ifdef CONFIG_COCOA
>>  void cocoa_display_init(DisplayState *ds, int full_screen);
>> +#endif
>>
>>  /* vnc.c */
>> +#ifdef CONFIG_VNC
>>  void vnc_display_init(DisplayState *ds);
>>  void vnc_display_close(DisplayState *ds);
>>  int vnc_display_open(DisplayState *ds, const char *display);
>>  void vnc_display_add_client(DisplayState *ds, int csock, int skipauth);
>>  int vnc_display_disable_login(DisplayState *ds);
>>  char *vnc_display_local_addr(DisplayState *ds);
>> -#ifdef CONFIG_VNC
>> +
>>  int vnc_display_password(DisplayState *ds, const char *password);
>>  int vnc_display_pw_expire(DisplayState *ds, time_t expires);
>>  void do_info_vnc_print(Monitor *mon, const QObject *data);
>> @@ -401,6 +406,8 @@ static inline void do_info_vnc_print(Monitor *mon,
>> const QObject *data)
>>  #endif
>>
>>  /* curses.c */
>> +#ifdef CONFIG_CURSES
>>  void curses_display_init(DisplayState *ds, int full_screen);
>> +#endif
>>
>>  #endif
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-26  2:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-26  2:24 [Qemu-devel] [PATCH] console: Don't expose the the ui module's functions when the module is not available TeLeMan
2011-07-26  2:32 ` Anthony Liguori
2011-07-26  2:56   ` TeLeMan

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).