Refactor how display drivers are selected

My previous commit, f92f8afebe,  broke -vnc (spotted by Glauber Costa).  This
is because it's necessary to tell when the no special display parameters have
been passed and default to SDL or VNC appropriately.

This refactors the display selection logic to be less complicated which has
the effect of fixing the regression mentioned above.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Anthony Liguori 2009-05-21 16:54:00 -05:00
parent ec6bd8dea7
commit 993fbfdb1b
5 changed files with 59 additions and 50 deletions

View file

@ -571,7 +571,7 @@ static void fd_chr_update_read_handler(CharDriverState *chr)
FDCharDriver *s = chr->opaque;
if (s->fd_in >= 0) {
if (nographic && s->fd_in == 0) {
if (display_type == DT_NOGRAPHIC && s->fd_in == 0) {
} else {
qemu_set_fd_handler2(s->fd_in, fd_chr_read_poll,
fd_chr_read, NULL, chr);
@ -584,7 +584,7 @@ static void fd_chr_close(struct CharDriverState *chr)
FDCharDriver *s = chr->opaque;
if (s->fd_in >= 0) {
if (nographic && s->fd_in == 0) {
if (display_type == DT_NOGRAPHIC && s->fd_in == 0) {
} else {
qemu_set_fd_handler2(s->fd_in, NULL, NULL, NULL, NULL);
}
@ -714,7 +714,7 @@ static void term_init(void)
tty.c_oflag |= OPOST;
tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN);
/* if graphical mode, we allow Ctrl-C handling */
if (nographic)
if (display_type == DT_NOGRAPHIC)
tty.c_lflag &= ~ISIG;
tty.c_cflag &= ~(CSIZE|PARENB);
tty.c_cflag |= CS8;