[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/3] ui/console: replace QEMUFIFO with Fifo8
From: |
Volker Rümelin |
Subject: |
Re: [PATCH 1/3] ui/console: replace QEMUFIFO with Fifo8 |
Date: |
Sun, 12 Sep 2021 19:58:08 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 |
@@ -1185,6 +1138,7 @@ void kbd_put_keysym_console(QemuConsole *s,
int keysym)
uint8_t buf[16], *q;
CharBackend *be;
int c;
+ uint32_t free;
Better call it num_free, to avoid symbol clash (even if we don't use
free() directly), it helps reading and can prevent mistakes.
Hi,
OK, I'll send a version 2 patch.
if (!s || (s->console_type == GRAPHIC_CONSOLE))
return;
@@ -2233,8 +2188,7 @@ static void text_console_do_init(Chardev
*chr, DisplayState *ds)
int g_width = 80 * FONT_WIDTH;
int g_height = 24 * FONT_HEIGHT;
- s->out_fifo.buf = s->out_fifo_buf;
- s->out_fifo.buf_size = sizeof(s->out_fifo_buf);
+ fifo8_create(&s->out_fifo, 16);
Missing a fif8_destroy() somewhere
An opened text console stays open until QEMU exits. There's no
text_console_close() function. Just like there's a ChardevClass open
call but no close call. I think this is one of the many cases in QEMU
where resources get allocated for the lifetime of QEMU.
With best regards,
Volker
s->kbd_timer = timer_new_ms(QEMU_CLOCK_REALTIME,
kbd_send_chars, s);
s->ds = ds;