From 616404cd42db5f683d49772dcc2c53c8f6466024 Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Sat, 15 Jun 2013 14:36:22 +0400 Subject: [PATCH 1/2] vl: always define no_frame Commit 047d4e151dd46 "Unbreak -no-quit for GTK, validate SDL options" broke build of qemu without sdl, by referencing `no_frame' variable which is defined inside #if SDL block. Fix that by defining that variable unconditionally. This is a better fix for the build issue introduced by that patch than a revert. This change keeps the new functinality introduced by that patch and just fixes the compilation. It still is not a complete fix around the original issue (not working -no-frame et al with -display gtk), because it makes only the legacy interface working, not the new suboption interface, so a few more changes are needed. Cc: Peter Wu Cc: qemu-trivial@nongnu.org Signed-off-by: Michael Tokarev Reviewed-by: Peter Wu --- vl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/vl.c b/vl.c index 9f8fd6e377..f94ec9ca17 100644 --- a/vl.c +++ b/vl.c @@ -199,9 +199,7 @@ static int rtc_date_offset = -1; /* -1 means no change */ QEMUClock *rtc_clock; int vga_interface_type = VGA_NONE; static int full_screen = 0; -#ifdef CONFIG_SDL static int no_frame = 0; -#endif int no_quit = 0; CharDriverState *serial_hds[MAX_SERIAL_PORTS]; CharDriverState *parallel_hds[MAX_PARALLEL_PORTS]; From b165b0d8e62bb65a02d7670d75ebb77a9280bde1 Mon Sep 17 00:00:00 2001 From: Vladimir Senkov Date: Sun, 16 Jun 2013 20:30:52 -0400 Subject: [PATCH 2/2] char/serial: fix copy&paste error (fifo8_is_full vs empty) Copy&paste error in serial.c causes a crash when attempting to read from UART (if there is no data to be read) Signed-off-by: Vladimir Senkov Reviewed-by: Peter Crosthwaite Signed-off-by: Michael Tokarev --- hw/char/serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/char/serial.c b/hw/char/serial.c index b537e426b0..6382f98389 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -424,7 +424,7 @@ static uint64_t serial_ioport_read(void *opaque, hwaddr addr, unsigned size) ret = s->divider & 0xff; } else { if(s->fcr & UART_FCR_FE) { - ret = fifo8_is_full(&s->recv_fifo) ? + ret = fifo8_is_empty(&s->recv_fifo) ? 0 : fifo8_pop(&s->recv_fifo); if (s->recv_fifo.num == 0) { s->lsr &= ~(UART_LSR_DR | UART_LSR_BI);