* [Qemu-devel] [PULL 0/2] console patches @ 2014-06-10 11:02 Gerd Hoffmann 2014-06-10 11:02 ` [Qemu-devel] [PULL 1/2] console: kill MAX_CONSOLES, alloc consoles dynamically Gerd Hoffmann ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: Gerd Hoffmann @ 2014-06-10 11:02 UTC (permalink / raw) To: qemu-devel; +Cc: Gerd Hoffmann Hi, Two little console bugfixes. please pull, Gerd The following changes since commit 7b0140e49b1c239c880c90235548917086f53cdc: Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20140610' into staging (2014-06-10 10:59:26 +0100) are available in the git repository at: git://git.kraxel.org/qemu tags/pull-console-20140610-1 for you to fetch changes up to 333cb18ff4aaf249b2e81a376bee2b15370f4784: console: fix -vga none -sdl crash (2014-06-10 12:36:36 +0200) ---------------------------------------------------------------- console: two little bugfixes. ---------------------------------------------------------------- Gerd Hoffmann (2): console: kill MAX_CONSOLES, alloc consoles dynamically console: fix -vga none -sdl crash ui/console.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PULL 1/2] console: kill MAX_CONSOLES, alloc consoles dynamically 2014-06-10 11:02 [Qemu-devel] [PULL 0/2] console patches Gerd Hoffmann @ 2014-06-10 11:02 ` Gerd Hoffmann 2014-06-10 11:02 ` [Qemu-devel] [PULL 2/2] console: fix -vga none -sdl crash Gerd Hoffmann 2014-06-10 11:47 ` [Qemu-devel] [PULL 0/2] console patches Peter Maydell 2 siblings, 0 replies; 4+ messages in thread From: Gerd Hoffmann @ 2014-06-10 11:02 UTC (permalink / raw) To: qemu-devel; +Cc: Gerd Hoffmann, Anthony Liguori Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> --- ui/console.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ui/console.c b/ui/console.c index 2ce55a6..b5dac64 100644 --- a/ui/console.c +++ b/ui/console.c @@ -30,7 +30,6 @@ #include "trace.h" #define DEFAULT_BACKSCROLL 512 -#define MAX_CONSOLES 12 #define CONSOLE_CURSOR_PERIOD 500 typedef struct TextAttributes { @@ -173,7 +172,7 @@ struct DisplayState { static DisplayState *display_state; static QemuConsole *active_console; -static QemuConsole *consoles[MAX_CONSOLES]; +static QemuConsole **consoles; static int nb_consoles = 0; static bool cursor_visible_phase; static QEMUTimer *cursor_timer; @@ -983,9 +982,6 @@ void console_select(unsigned int index) DisplayChangeListener *dcl; QemuConsole *s; - if (index >= MAX_CONSOLES) - return; - trace_console_select(index); s = qemu_console_lookup_by_index(index); if (s) { @@ -1191,9 +1187,6 @@ static QemuConsole *new_console(DisplayState *ds, console_type_t console_type, QemuConsole *s; int i; - if (nb_consoles >= MAX_CONSOLES) - return NULL; - obj = object_new(TYPE_QEMU_CONSOLE); s = QEMU_CONSOLE(obj); s->head = head; @@ -1211,6 +1204,8 @@ static QemuConsole *new_console(DisplayState *ds, console_type_t console_type, } s->ds = ds; s->console_type = console_type; + + consoles = g_realloc(consoles, sizeof(*consoles) * (nb_consoles+1)); if (console_type != GRAPHIC_CONSOLE) { s->index = nb_consoles; consoles[nb_consoles++] = s; @@ -1634,7 +1629,7 @@ QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head, QemuConsole *qemu_console_lookup_by_index(unsigned int index) { - if (index >= MAX_CONSOLES) { + if (index >= nb_consoles) { return NULL; } return consoles[index]; -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PULL 2/2] console: fix -vga none -sdl crash 2014-06-10 11:02 [Qemu-devel] [PULL 0/2] console patches Gerd Hoffmann 2014-06-10 11:02 ` [Qemu-devel] [PULL 1/2] console: kill MAX_CONSOLES, alloc consoles dynamically Gerd Hoffmann @ 2014-06-10 11:02 ` Gerd Hoffmann 2014-06-10 11:47 ` [Qemu-devel] [PULL 0/2] console patches Peter Maydell 2 siblings, 0 replies; 4+ messages in thread From: Gerd Hoffmann @ 2014-06-10 11:02 UTC (permalink / raw) To: qemu-devel; +Cc: Gerd Hoffmann, Anthony Liguori Call get_alloc_displaystate() for proper initialization instead of allocating with g_new(). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> --- ui/console.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ui/console.c b/ui/console.c index b5dac64..7dc4c14 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1580,10 +1580,7 @@ DisplayState *init_displaystate(void) gchar *name; int i; - if (!display_state) { - display_state = g_new0(DisplayState, 1); - } - + get_alloc_displaystate(); for (i = 0; i < nb_consoles; i++) { if (consoles[i]->console_type != GRAPHIC_CONSOLE && consoles[i]->ds == NULL) { -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] console patches 2014-06-10 11:02 [Qemu-devel] [PULL 0/2] console patches Gerd Hoffmann 2014-06-10 11:02 ` [Qemu-devel] [PULL 1/2] console: kill MAX_CONSOLES, alloc consoles dynamically Gerd Hoffmann 2014-06-10 11:02 ` [Qemu-devel] [PULL 2/2] console: fix -vga none -sdl crash Gerd Hoffmann @ 2014-06-10 11:47 ` Peter Maydell 2 siblings, 0 replies; 4+ messages in thread From: Peter Maydell @ 2014-06-10 11:47 UTC (permalink / raw) To: Gerd Hoffmann; +Cc: QEMU Developers On 10 June 2014 12:02, Gerd Hoffmann <kraxel@redhat.com> wrote: > Hi, > > Two little console bugfixes. > > please pull, > Gerd > > The following changes since commit 7b0140e49b1c239c880c90235548917086f53cdc: > > Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20140610' into staging (2014-06-10 10:59:26 +0100) > > are available in the git repository at: > > > git://git.kraxel.org/qemu tags/pull-console-20140610-1 > > for you to fetch changes up to 333cb18ff4aaf249b2e81a376bee2b15370f4784: > > console: fix -vga none -sdl crash (2014-06-10 12:36:36 +0200) > > ---------------------------------------------------------------- > console: two little bugfixes. > > ---------------------------------------------------------------- Applied, thanks. -- PMM ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-06-10 11:48 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-06-10 11:02 [Qemu-devel] [PULL 0/2] console patches Gerd Hoffmann 2014-06-10 11:02 ` [Qemu-devel] [PULL 1/2] console: kill MAX_CONSOLES, alloc consoles dynamically Gerd Hoffmann 2014-06-10 11:02 ` [Qemu-devel] [PULL 2/2] console: fix -vga none -sdl crash Gerd Hoffmann 2014-06-10 11:47 ` [Qemu-devel] [PULL 0/2] console patches Peter Maydell
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).