Patchwork [6/7] error message if user specifies curses on cmd line when curses is disabled

login
register
mail settings
Submitter Jes Sorensen
Date March 15, 2011, 12:36 p.m.
Message ID <1300192574-32644-7-git-send-email-Jes.Sorensen@redhat.com>
Download mbox | patch
Permalink /patch/86975/
State New
Headers show

Comments

Jes Sorensen - March 15, 2011, 12:36 p.m.
From: Jes Sorensen <Jes.Sorensen@redhat.com>

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 qemu-options.hx |    2 --
 vl.c            |    7 +++++--
 2 files changed, 5 insertions(+), 4 deletions(-)

Patch

diff --git a/qemu-options.hx b/qemu-options.hx
index ee7e1d7..b6b125c 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -639,11 +639,9 @@  the console. Therefore, you can still use QEMU to debug a Linux kernel
 with a serial console.
 ETEXI
 
-#ifdef CONFIG_CURSES
 DEF("curses", 0, QEMU_OPTION_curses,
     "-curses         use a curses/ncurses interface instead of SDL\n",
     QEMU_ARCH_ALL)
-#endif
 STEXI
 @item -curses
 @findex curses
diff --git a/vl.c b/vl.c
index 4bc81cf..baa267a 100644
--- a/vl.c
+++ b/vl.c
@@ -2248,11 +2248,14 @@  int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_nographic:
                 display_type = DT_NOGRAPHIC;
                 break;
-#ifdef CONFIG_CURSES
             case QEMU_OPTION_curses:
+#ifdef CONFIG_CURSES
                 display_type = DT_CURSES;
-                break;
+#else
+                fprintf(stderr, "Curses support is disabled\n");
+                exit(1);
 #endif
+                break;
             case QEMU_OPTION_portrait:
                 graphic_rotate = 1;
                 break;