From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKFCG-0001Ym-WB for qemu-devel@nongnu.org; Mon, 25 Mar 2013 17:44:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKFCF-000175-Po for qemu-devel@nongnu.org; Mon, 25 Mar 2013 17:44:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31325) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKFCF-00015Z-Hn for qemu-devel@nongnu.org; Mon, 25 Mar 2013 17:44:51 -0400 Date: Mon, 25 Mar 2013 17:44:47 -0400 From: Luiz Capitulino Message-ID: <20130325174447.0aac491a@redhat.com> In-Reply-To: <5150BC98.5060906@redhat.com> References: <1364240439-23450-1-git-send-email-lcapitulino@redhat.com> <1364240439-23450-3-git-send-email-lcapitulino@redhat.com> <5150BC98.5060906@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] Monitor: Make output buffer dynamic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: fred.konrad@greensocs.com, qemu-devel@nongnu.org, kraxel@redhat.com On Mon, 25 Mar 2013 22:07:36 +0100 Paolo Bonzini wrote: > Il 25/03/2013 20:40, Luiz Capitulino ha scritto: > > Commit f628926bb423fa8a7e0b114511400ea9df38b76a changed monitor_flush() > > to retry on qemu_chr_fe_write() errors. However, the Monitor's output > > buffer can keep growing while the retry is not issued and this can > > cause the buffer to overflow. > > > > To reproduce this issue, just start qemu and type on the Monitor: > > > > (qemu) ? > > > > This will cause the assertion to trig. > > > > To fix this problem this commit makes the Monitor buffer dynamic, > > which means that it can grow as much as needed. > > What about using a GString instead? Makes no difference for me (although I don't enjoy mixing QString and GString in the same module), but if we do this with the goal of stopping QString proliferation then we should note somewhere that it shouldn't be used in new code anymore.