From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Me9X0-0005b3-Ex for qemu-devel@nongnu.org; Thu, 20 Aug 2009 11:26:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Me9Wv-0005ZU-0Z for qemu-devel@nongnu.org; Thu, 20 Aug 2009 11:26:25 -0400 Received: from [199.232.76.173] (port=55043 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Me9Wu-0005ZR-R7 for qemu-devel@nongnu.org; Thu, 20 Aug 2009 11:26:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22192) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Me9Wt-0001oD-8a for qemu-devel@nongnu.org; Thu, 20 Aug 2009 11:26:19 -0400 Message-ID: <4A8D6B16.5060706@redhat.com> Date: Thu, 20 Aug 2009 18:26:14 +0300 From: Avi Kivity MIME-Version: 1.0 References: <1250723280-3509-1-git-send-email-lcapitulino@redhat.com> <1250723280-3509-5-git-send-email-lcapitulino@redhat.com> <4A8D0202.7020803@redhat.com> <20090820105756.1bd958c8@doriath> <4A8D589D.2060208@redhat.com> <20090820120828.5c5c66e5@doriath> In-Reply-To: <20090820120828.5c5c66e5@doriath> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 04/29] Introduce QDict List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org On 08/20/2009 06:08 PM, Luiz Capitulino wrote: >> The current code, no, but once we read qdicts from the monitor, you need >> to be able to handle { a: 1, a: 2 }. >> > qdict_add() will refuse to add an existing key, but I can change > it to replace instead. > > Would this be enough? > Yes, that's the standard behaviour. Rename it qdict_put() though. >>>> This assumption does not hold if the dict came from a user. >>>> >>>> >>> Then the user has to know what he or she is doing. :) >>> >>> >> They don't, as a rule. >> > That's why there's an assert() there. :) > You don't want user input triggering asserts (I'm talking user in the sense of something external to the program, not in the sense of code in qemu using this function). -- error compiling committee.c: too many arguments to function