Revision 1472a95b

b/qemu-options.hx
590 590
@table @option
591 591
ETEXI
592 592

  
593
DEF("display", HAS_ARG, QEMU_OPTION_display,
594
    "-display sdl[,frame=on|off][,alt_grab=on|off][,ctrl_grab=on|off]\n"
595
    "            [,window_close=on|off]|curses\n"
596
    "                select display type\n", QEMU_ARCH_ALL)
597
STEXI
598
@item -display @var{type}
599
@findex -display
600
Select type of display to use. This option is a replacement for the
601
old style -sdl/-curses/... options. Valid values for @var{type} are
602
@table @option
603
@item sdl
604
Display video output via SDL (usually in a separate graphics
605
window; see the SDL documentation for other possibilities).
606
@item curses
607
Display video output via curses. For graphics device models which
608
support a text mode, QEMU can display this output using a
609
curses/ncurses interface. Nothing is displayed when the graphics
610
device is in graphical mode or if the graphics device does not support
611
a text mode. Generally only the VGA device models support text mode.
612
@end table
613
ETEXI
614

  
593 615
DEF("nographic", 0, QEMU_OPTION_nographic,
594 616
    "-nographic      disable graphical output and redirect serial I/Os to console\n",
595 617
    QEMU_ARCH_ALL)
b/vl.c
1555 1555
    }
1556 1556
}
1557 1557

  
1558
static DisplayType select_display(const char *p)
1559
{
1560
    const char *opts;
1561
    DisplayType display = DT_DEFAULT;
1562

  
1563
    if (strstart(p, "sdl", &opts)) {
1564
#ifdef CONFIG_SDL
1565
        display = DT_SDL;
1566
        while (*opts) {
1567
            const char *nextopt;
1568

  
1569
            if (strstart(opts, ",frame=", &nextopt)) {
1570
                opts = nextopt;
1571
                if (strstart(opts, "on", &nextopt)) {
1572
                    no_frame = 0;
1573
                } else if (strstart(opts, "off", &nextopt)) {
1574
                    no_frame = 1;
1575
                } else {
1576
                    goto invalid_display;
1577
                }
1578
            } else if (strstart(opts, ",alt_grab=", &nextopt)) {
1579
                opts = nextopt;
1580
                if (strstart(opts, "on", &nextopt)) {
1581
                    alt_grab = 1;
1582
                } else if (strstart(opts, "off", &nextopt)) {
1583
                    alt_grab = 0;
1584
                } else {
1585
                    goto invalid_display;
1586
                }
1587
            } else if (strstart(opts, ",ctrl_grab=", &nextopt)) {
1588
                opts = nextopt;
1589
                if (strstart(opts, "on", &nextopt)) {
1590
                    ctrl_grab = 1;
1591
                } else if (strstart(opts, "off", &nextopt)) {
1592
                    ctrl_grab = 0;
1593
                } else {
1594
                    goto invalid_display;
1595
                }
1596
            } else if (strstart(opts, ",window_close=", &nextopt)) {
1597
                opts = nextopt;
1598
                if (strstart(opts, "on", &nextopt)) {
1599
                    no_quit = 0;
1600
                } else if (strstart(opts, "off", &nextopt)) {
1601
                    no_quit = 1;
1602
                } else {
1603
                    goto invalid_display;
1604
                }
1605
            } else {
1606
                goto invalid_display;
1607
            }
1608
            opts = nextopt;
1609
        }
1610
#else
1611
        fprintf(stderr, "SDL support is disabled\n");
1612
        exit(1);
1613
#endif
1614
    } else if (strstart(p, "curses", &opts)) {
1615
#ifdef CONFIG_CURSES
1616
        display = DT_CURSES;
1617
#else
1618
        fprintf(stderr, "Curses support is disabled\n");
1619
        exit(1);
1620
#endif
1621
    } else {
1622
    invalid_display:
1623
        fprintf(stderr, "Unknown display type: %s\n", p);
1624
        exit(1);
1625
    }
1626

  
1627
    return display;
1628
}
1629

  
1558 1630
static int balloon_parse(const char *arg)
1559 1631
{
1560 1632
    QemuOpts *opts;
......
2153 2225
                }
2154 2226
                numa_add(optarg);
2155 2227
                break;
2228
            case QEMU_OPTION_display:
2229
                display_type = select_display(optarg);
2230
                break;
2156 2231
            case QEMU_OPTION_nographic:
2157 2232
                display_type = DT_NOGRAPHIC;
2158 2233
                break;

Also available in: Unified diff