- Jan 04, 2021
-
-
Alex Chen authored
When the 'cmdline' is the last entry in 'rs->history' array, there is no need to put this entry to the end of the array, partly because it is the last entry, and partly because the next operition will lead to array index out of bounds. Reported-by:
Euler Robot <euler.robot@huawei.com> Signed-off-by:
Alex Chen <alex.chen@huawei.com> Message-id: 20201203135043.117072-1-alex.chen@huawei.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- Jun 11, 2019
-
-
Markus Armbruster authored
Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190523143508.25387-3-armbru@redhat.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org>
-
- May 10, 2019
-
-
Jules Irenge authored
Add braces to fix errors issued by checkpatch.pl tool "ERROR: braces {} are necessary for all arms of this statement" Within "util/readline.c" file Message-Id: <20190330112142.14082-1-jbi.octave@gmail.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Jules Irenge authored
Replace tab indent by four spaces to fix errors issued by checkpatch.pl tool "ERROR: code indent should never use tabs" within "util/readline.c" file. Signed-off-by:
Jules Irenge <jbi.octave@gmail.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Message-id: 20190401024406.10819-3-jbi.octave@gmail.com Message-Id: <20190401024406.10819-3-jbi.octave@gmail.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
Jules Irenge authored
util/readline: add a space to fix errors reported by checkpatch.pl tool "ERROR: space required before the open parenthesis" "ERROR: space required after that ..." within "util/redline.c" file Signed-off-by:
Jules Irenge <jbi.octave@gmail.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Message-id: 20190401024406.10819-2-jbi.octave@gmail.com Message-Id: <20190401024406.10819-2-jbi.octave@gmail.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- Feb 05, 2018
-
-
Greg Kurz authored
Since commit e5dc1a6c, QEMU aborts on exit if completion was used in the monitor: *** Error in `obj/ppc64-softmmu/qemu-system-ppc64': double free or corruption (fasttop): 0x00000100331069d0 *** /home/greg/Work/qemu/qemu-spapr/util/readline.c:514 /home/greg/Work/qemu/qemu-spapr/monitor.c:586 /home/greg/Work/qemu/qemu-spapr/monitor.c:4125 argv=<optimized out>, envp=<optimized out>) at /home/greg/Work/qemu/qemu-spapr/vl.c:4795 Completion strings are not persistent accross completions (why would they?). They are allocated under readline_completion(), which already takes care of freeing them before returning. Maybe all completion related bits should be moved out of ReadLineState to a dedicated structure ? In the meantime, let's drop the offending lines from readline_free() to fix the crash. Signed-off-by:
Greg Kurz <groug@kaod.org> Message-Id: <151627206353.4505.4602428849861610759.stgit@bahia.lan> Fixes: e5dc1a6c Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jan 16, 2018
-
-
Marc-André Lureau authored
Fixes leaks such as: Direct leak of 2 byte(s) in 1 object(s) allocated from: #0 0x7eff58beb850 in malloc (/lib64/libasan.so.4+0xde850) #1 0x7eff57942f0c in g_malloc ../glib/gmem.c:94 #2 0x7eff579431cf in g_malloc_n ../glib/gmem.c:331 #3 0x7eff5795f6eb in g_strdup ../glib/gstrfuncs.c:363 #4 0x55db720f1d46 in readline_hist_add /home/elmarco/src/qq/util/readline.c:258 #5 0x55db720f2d34 in readline_handle_byte /home/elmarco/src/qq/util/readline.c:387 #6 0x55db71539d00 in monitor_read /home/elmarco/src/qq/monitor.c:3896 #7 0x55db71f9be35 in qemu_chr_be_write_impl /home/elmarco/src/qq/chardev/char.c:167 #8 0x55db71f9bed3 in qemu_chr_be_write /home/elmarco/src/qq/chardev/char.c:179 #9 0x55db71fa013c in fd_chr_read /home/elmarco/src/qq/chardev/char-fd.c:66 #10 0x55db71fe18a8 in qio_channel_fd_source_dispatch /home/elmarco/src/qq/io/channel-watch.c:84 #11 0x7eff5793a90b in g_main_dispatch ../glib/gmain.c:3182 #12 0x7eff5793b7ac in g_main_context_dispatch ../glib/gmain.c:3847 #13 0x55db720af3bd in glib_pollfds_poll /home/elmarco/src/qq/util/main-loop.c:214 #14 0x55db720af505 in os_host_main_loop_wait /home/elmarco/src/qq/util/main-loop.c:261 #15 0x55db720af6d6 in main_loop_wait /home/elmarco/src/qq/util/main-loop.c:515 #16 0x55db7184e0de in main_loop /home/elmarco/src/qq/vl.c:1995 #17 0x55db7185e956 in main /home/elmarco/src/qq/vl.c:4914 #18 0x7eff4ea17039 in __libc_start_main (/lib64/libc.so.6+0x21039) (while at it, use g_new0(ReadLineState), it's a bit easier to read) Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20180104160523.22995-11-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Mar 22, 2016
-
-
Veronia Bahaa authored
Move declarations out of qemu-common.h for functions declared in utils/ files: e.g. include/qemu/path.h for utils/path.c. Move inline functions out of qemu-common.h and into new files (e.g. include/qemu/bcd.h) Signed-off-by:
Veronia Bahaa <veroniabahaa@gmail.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Feb 04, 2016
-
-
Peter Maydell authored
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-id: 1454089805-5470-6-git-send-email-peter.maydell@linaro.org
-
- Jun 11, 2014
-
-
Hani Benhabiles authored
Signed-off-by:
Hani Benhabiles <hani@linux.com> Signed-off-by:
Luiz Capitulino <lcapitulino@redhat.com>
-
Hani Benhabiles authored
There is no need to clutter the user's choices with repeating the same value multiple times. Signed-off-by:
Hani Benhabiles <hani@linux.com> Signed-off-by:
Luiz Capitulino <lcapitulino@redhat.com>
-
- May 07, 2014
-
-
Hani Benhabiles authored
Signed-off-by:
Hani Benhabiles <hani@linux.com> Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru>
-
Michael Tokarev authored
Signed-off-by:
Michael Tokarev <mjt@tls.msk.ru> Reviewed-by:
Andreas Färber <afaerber@suse.de>
-
- Jan 22, 2014
-
-
Stefan Hajnoczi authored
Now that the monitor and readline are decoupled, readline.h no longer belongs in include/monitor/. Put the header into include/qemu/. Move the source file into util/ so it can be linked as part of libqemuutil.a. Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Stefan Hajnoczi authored
Make the readline.c functionality reusable. Instead of calling monitor_printf() and monitor_flush() directly, invoke function pointers provided by the user. This way readline.c does not know about Monitor and other users will be able to make use of readline.c. Note that there is already an "opaque" argument to the ReadLineFunc callback. Consistently call it "readline_opaque" from now on to distinguish from the ReadLinePrintfFunc/ReadLineFlushFunc "opaque" argument. I also dropped the printf macro trickery since it's now highly unlikely that anyone modifying readline.c would call printf(3) directly. We no longer need this protection. Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
- Aug 30, 2013
-
-
Wenchao Xia authored
Now all completion functions do not use *cur_mon any more, instead they use rs->mon. In short, structure ReadLineState decide where the complete action would be taken now. Tested with the case that qemu have two telnet monitors, auto completion function works normal. Signed-off-by:
Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Luiz Capitulino <lcapitulino@redhat.com>
-
Wenchao Xia authored
Parameter *mon is added, and local variable *mon added in previous patch is removed. The caller readline_completion(), pass rs->mon as value, which should be initialized in readline_init() called by monitor_init(). Signed-off-by:
Wenchao Xia <xiawenc@linux.vnet.ibm.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Luiz Capitulino <lcapitulino@redhat.com>
-
- May 14, 2013
-
-
Kevin Wolf authored
This fixes the Home/End keys in the monitor using the GTK frontend. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Message-id: 1368526554-15866-1-git-send-email-kwolf@redhat.com Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Jan 30, 2013
-
-
Markus Armbruster authored
Signed-off-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- Jan 08, 2013
-
-
Nickolai Zeldovich authored
memcpy() for overlapping regions is undefined behavior; use memmove() instead in readline_hist_add(). [Keep tab characters since surrounding code still uses them -- Stefan] Signed-off-by:
Nickolai Zeldovich <nickolai@csail.mit.edu> Reviewed-by:
Richard Henderson <rth@twiddle.net> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- Dec 19, 2012
-
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jun 15, 2012
-
-
Stefan Weil authored
Each string which is shown during readline completion in the QEMU monitor is allocated dynamically but currently never deallocated. Add the missing loop which calls g_free for the allocated strings. Signed-off-by:
Stefan Weil <sw@weilnetz.de> Reviewed-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by:
Luiz Capitulino <lcapitulino@redhat.com>
-
- Jun 11, 2012
-
-
Stefan Weil authored
Each string which is shown during readline completion in the QEMU monitor is allocated dynamically but currently never deallocated. Add the missing loop which calls g_free for the allocated strings. Signed-off-by:
Stefan Weil <sw@weilnetz.de> Reviewed-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-
- Nov 07, 2011
-
-
Markus Armbruster authored
readline_hist_add() moves the history entry to the end of history. It uses memmove() to move rs->history[idx + 1..] to rs->history[idx..]. However, its size argument is off by two array elements, so it writes one element beyond rs->history[], and reads two. On my system, this clobbers rs->hist_entry and the hole right after it. Since the function assigns to rs->hist_entry in time, the bug has no ill effects for me. Spotted by Coverity. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-
- Aug 21, 2011
-
-
Anthony Liguori authored
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Feb 08, 2010
-
-
Paolo Bonzini authored
Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
malc <av1474@comtv.ru>
-
- Feb 06, 2010
-
-
malc authored
Signed-off-by:
malc <av1474@comtv.ru>
-
- Jun 16, 2009
-
-
Luiz Capitulino authored
qemu_mallocz() already checks for NULL returns, readline_init() doesn't have to do it again. Signed-off-by:
Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com>
-
- Mar 13, 2009
-
-
Anthony Liguori authored
Provide an empty line as last entry in command line history, just like bash e.g. does. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6842 c046a42c-6fe2-441c-8c8c-71466251a162
-
- Mar 05, 2009
-
-
Anthony Liguori authored
Up to now, you never really knew if you already switched the console after pressing CTRL-A C or if you mistyped it again. This patch clarifies the situation by providing a prompt in a new line and injecting a linebreak when switching away again. For this purpose, the two events CHR_EVENT_MUX_IN and CHR_EVENT_MUX_OUT are introduced and distributed on focus switches. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6716 c046a42c-6fe2-441c-8c8c-71466251a162
-
Anthony Liguori authored
As another step towards decoupled monitor terminals encapsulate the state of the readline processor in a separate data structure called ReadLineState and adapt all interfaces appropriately. For now the monitor continues to instantiate just a single readline state. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6714 c046a42c-6fe2-441c-8c8c-71466251a162
-
Anthony Liguori authored
Refactor the monitor API and prepare it for decoupled terminals: term_print functions are renamed to monitor_* and all monitor services gain a new parameter (mon) that will once refer to the monitor instance the output is supposed to appear on. However, the argument remains unused for now. All monitor command callbacks are also extended by a mon parameter so that command handlers are able to pass an appropriate reference to monitor output services. For the case that monitor outputs so far happen without clearly identifiable context, the global variable cur_mon is introduced that shall once provide a pointer either to the current active monitor (while processing commands) or to the default one. On the mid or long term, those use case will be obsoleted so that this variable can be removed again. Due to the broad usage of the monitor interface, this patch mostly deals with converting users of the monitor API. A few of them are already extended to pass 'mon' from the command handler further down to internal functions that invoke monitor_printf. At this chance, monitor-related prototypes are moved from console.h to a new monitor.h. The same is done for the readline API. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6711 c046a42c-6fe2-441c-8c8c-71466251a162
-
Anthony Liguori authored
Break readline_show_prompt out of readline_start so that (re-)printing the prompt can be controlled in a more fine-grained way. Signed-off-by:
Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6709 c046a42c-6fe2-441c-8c8c-71466251a162
-
- Feb 05, 2009
-
-
Anthony Liguori authored
Signed-off-by:
Avi Kivity <avi@redhat.com> Signed-off-by:
Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6531 c046a42c-6fe2-441c-8c8c-71466251a162
-
- Dec 13, 2008
-
-
Blue Swirl authored
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6000 c046a42c-6fe2-441c-8c8c-71466251a162
-
- Nov 16, 2008
-
-
Blue Swirl authored
when compiling on NetBSD: warning: array subscript has type 'char' Signed-off-by:
Christoph Egger <Christoph.Egger@amd.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5727 c046a42c-6fe2-441c-8c8c-71466251a162
-
- Dec 17, 2007
-
-
Thiemo Seufer authored
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3835 c046a42c-6fe2-441c-8c8c-71466251a162
-
- Nov 17, 2007
-
-
Paul Brook authored
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3674 c046a42c-6fe2-441c-8c8c-71466251a162
-
- Sep 25, 2007
-
-
Thiemo Seufer authored
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3233 c046a42c-6fe2-441c-8c8c-71466251a162
-