]> Git Repo - qemu.git/blobdiff - vl.c
Eliminate --disable-gfx-check and make VNC default when SDL not available
[qemu.git] / vl.c
diff --git a/vl.c b/vl.c
index 9f25cd40d5620766ae9557d1bc943180709ffd89..e28da7ed7d6ed858112b2c363e46fdd6231ccd37 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -203,7 +203,7 @@ enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;
 static DisplayState *display_state;
 int nographic;
 static int curses;
-static int sdl;
+static int sdl = 1;
 const char* keyboard_layout = NULL;
 int64_t ticks_per_sec;
 ram_addr_t ram_size;
@@ -5952,25 +5952,36 @@ int main(int argc, char **argv, char **envp)
         }
     } else { 
 #if defined(CONFIG_CURSES)
-            if (curses) {
-                /* At the moment curses cannot be used with other displays */
-                curses_display_init(ds, full_screen);
-            } else
+        if (curses) {
+            /* At the moment curses cannot be used with other displays */
+            curses_display_init(ds, full_screen);
+        } else
 #endif
-            {
-                if (vnc_display != NULL) {
-                    vnc_display_init(ds);
-                    if (vnc_display_open(ds, vnc_display) < 0)
-                        exit(1);
-                }
+#if defined(CONFIG_SDL) || defined(CONFIG_COCOA)
+        if (sdl) {
 #if defined(CONFIG_SDL)
-                if (sdl || !vnc_display)
-                    sdl_display_init(ds, full_screen, no_frame);
+            sdl_display_init(ds, full_screen, no_frame);
 #elif defined(CONFIG_COCOA)
-                if (sdl || !vnc_display)
-                    cocoa_display_init(ds, full_screen);
+            cocoa_display_init(ds, full_screen);
+#endif
+        } else
 #endif
+        {
+            int print_port = 0;
+
+            if (vnc_display == NULL) {
+                vnc_display = "localhost:0,to=99";
+                print_port = 1;
             }
+
+            vnc_display_init(ds);
+            if (vnc_display_open(ds, vnc_display) < 0)
+                exit(1);
+
+            if (print_port) {
+                printf("VNC server running on `%s'\n", vnc_display_local_addr(ds));
+            }
+        }
     }
     dpy_resize(ds);
 
This page took 0.026661 seconds and 4 git commands to generate.